“Technology Support and Web Design for Businesses and Homes.”

Home SOHO Blog
SOHO Blog
Log in all users with Apple Remote Desktop on 10.4 Intel iMacs | Print |  E-mail
Written by Alex Shorthouse   
Thursday, 21 February 2008 15:24

 

Problem: You want to log in many Intel iMac computers with one username and password.

Solution: Send the machines the following Unix command. Replace USERNAME and PASSWORD with your username and password. "Keystroke return" must be sent twice for it to work.

osascript <<EndOfMyScript
tell application "System Events"
keystroke "USERNAME"
keystroke tab
delay 3.0
keystroke "PASSWORD"
delay 3.0
keystroke return
keystroke return
end tell
EndOfMyScript

 
Remove Dashboard for Network Users on Mac OS 10.4+ | Print |  E-mail
User Rating: / 2
PoorBest 
Written by Alex Shorthouse   
Friday, 15 February 2008 15:27

 

Problem: Users on your network spend time finding, installing, and playing with Dashboard Widgets when they could be doing something constructive.

Solution: Remove Dashboard.

From a terminal type:

"

sudo rm -R /System/Library/CoreServices/Dock.app/Contents/Resources/dash*

sudo rm -R /System/Library/CoreServices/Dock.app/Contents/Resources/Dash*

sudo rm -R /System/Library/CoreServices/Dock.app/Contents/Resources/wid*

sudo rm -R /System/Library/CoreServices/Dock.app/Contents/Resources/Wid*

"

This will disable Dashboard for any user on the network. This is easier and more reliable then sending out modified dashboard.plist files to each user, especially in a lab.

When a user tries to use the Dashboard, their dock will quickly disappear then reappear and Dashboard will not launch.

 
Disappearing Network Folders with Mac OS X users on a Windows AD Network | Print |  E-mail
Written by Alex Shorthouse   
Thursday, 08 November 2007 09:25

Instructions on cleaning Netinfo Manager and the disappearing network folders:

Summary of Problem: Mac OS X users logging into our Windows managed Active Directory Network sometimes had no network folder in their dock or desktop.

Description: We found that on certain computers when certain users logged in, they would not get a network folder. This problem arose because Netinfo Manager was caching certain network settings. If a user got cached, they would be unable to ever get their network folder on that computer. The solution was to open the utilities folder, then Netinfo Manager, then click on MCX_Cache, then click on Users and choose delete. Also, to check in Netinfo Manager, then Users, for the users login name. If a person was in the Users section of Netinfo Manager, they could have their password rejected (often their name showed up twice in it). Network users in the Netinfo/Users folder could be safely deleted. This had no adverse side effects and restored the user's network folder. But, users might then have their settings cached on the same computer again or a different computer later. This led to a few emails a week about disappearing network folders.

Solution: The solution was then to make a script to clear the MCX_Cache, so every time a user logged out the Mac would clear the MCX_Cache and remove the user from the NetinfoManager's Users folder. I found that there was a command in a terminal, "niutil", that had an option "-destroy" to delete information in the Netinfo manager.

So first I made a simple script. I called it "logout.sh"

The code in it is:

 

#!/bin/bash
#This line runs niutil and tells it to destroy everything in MCX_Cache. We can safely destroy everything in mcx_cache as nothing of use is in there.
niutil -destroy . /mcx_cache/users
#As a logout script, this is automatically ran as root. The username is passed to the script as $1. I change $1 to username, just to make things easier to read.
username=$1
#Now we run a check to make sure we don't delete root or administrator. Deleting root will force you to reinstall the OS (I personally know). This is a multiple if statement. Case begins the statement and esac ends it.
case "$username" in
'administrator') exit
;;
'root') exit
;;
esac
#Now we have the last user logged in, we know it is not root or admin, so we can delete it safely. Again we use niutil and destroy.
niutil -destroy . /users/$username

 

On our network, the only local accounts are "administrator" and "root." If your computers have more local accounts, add their names too. If you delete a local account from NetinfoManager, you will not be able to log into it. Delete root and you will have to reinstall the OS.

Now I needed this script to run at logout. To run niutil, you need root rights, but with logout scripts, they run automatically as root. With the terminal, you can modify what scripts are run at login. To do this, open a terminal. Then:
In 10.4.x type "sudo defaults write com.apple.loginwindow LogoutHook [path to your script]."
In 10.3.x type "sudo defaults write /Library/Preferences/com.apple.loginwindow LogoutHook [path to your script]"
In our case, we kept the script on a 10.4 mac in a folder called logoutscript in the base of the HD. Thus, the terminal command was "sudo defaults write com.apple.loginwindow LogoutHook /logoutscript/logout.sh"
One final note, make the script, "logout.sh" only read and writable by root. Otherwise someone could edit the file and run any command at logout.
After all that, the script would clear /mcx_cache/users and /Users/(last person logged in) every time at logout and network folders appeared all the time.