This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #################################################################################################### | |
| # | |
| # License: https://macmule.com/license/ | |
| # | |
| #################################################################################################### | |
| ############# | |
| # | |
| # Add all users to lpadmin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>com.macmule.drivesandprinters</string> | |
| <key>Program</key> | |
| <string>/Applications/Macmule Drives And Printers.app/Contents/MacOS/applet</string> | |
| <key>RunAtLoad</key> | |
| <true/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------------------------------------------------------------------------------------------------- | |
| -- | |
| -- License: https://macmule.com/license/ | |
| -- | |
| ---------------------------------------------------------------------------------------------------- | |
| ------------------------------- | |
| --- User Information | |
| ------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---- Map Printers | |
| if ADGroups contains "GROUPNAME" then | |
| if installedPrinters does not contain "PRINTERNAME" then | |
| try | |
| do shell script "/usr/sbin/lpadmin -p PRINTERNAME -E -v lpd://PRINTERIP -P PPDLOCATION -L \"PRINTERLOCATION\" -o printer-is-shared=false" | |
| on error | |
| do shell script "/usr/sbin/lpadmin -p PRINTERNAME -E -v lpd://PRINTERIP -P /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd -L \"PRINTERLOCATION\" -o printer-is-shared=false" | |
| end try | |
| end if | |
| end if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---- List All Printers | |
| try | |
| set installedPrinters to do shell script "lpstat -a" | |
| on error | |
| set installedPrinters to "" | |
| end try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --Home Folder -- Maps the drive specified in the profile field for the AD User continue if user has no profile path set | |
| try | |
| mount volume "smb:" & ADHome | |
| on error | |
| -- If the mount fails | |
| end try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Checks to see if account is an AD Account, if its not exit | |
| if accountType is less than 1000 then | |
| tell me to quit | |
| end if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Get the Users AD Home Folder | |
| set ADHome to do shell script "dscl " & quoted form of nodeName & " -read /Users/" & loggedInUser & "| grep SMBHome: | cut -c 10- | sed 's/\\\\/\\//g' " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Get the Users group membership from AD | |
| set ADGroups to do shell script "dscl " & quoted form of nodeName & " -read /Users/" & loggedInUser & " | awk '/^dsAttrTypeNative:memberOf:/,/^dsAttrTypeNative:msExchHomeServerName:/'" |