Archive for May, 2012

Add a Windows 2003 shared printer to a Windows 7 client.

While trying to connect to shared printer on a Windows 2003 server (32 bit) from a Windows 7 (32 bit) client, I kept getting a “Windows cannot connect to the printer. Operation failed with error 0x0000002.” I stumbled on an interesting little trick to get around this issue.

First, I created the printer locally and allowed Windows 7 to install the appropriate driver. After the printer has been created, I went into the printer Properties and clicked on the Ports tab. Then, Add Port… Select Local Port, and click New Port… Enter the UNC to the printer share name. For example, \\servername\printersharename.

Then, the printer worked an used the Windows 2003 print share. It is not the cleanest solution, but it does get the printer working using the shared printer on the Windows 2003 server.

MacOS – modify hostname from Terminal.

You can use the scutil command to change the hostname of a MacOS computer.

$ hostname

$ sudo scutil –set HostName
$ hostname

Likewise, you can change the ComputerName variable too:

$ sudo scutil –set ComputerName

Windows Logon script from local policy.

I keep forgetting the location of this setting, so I am documenting it so I can find it easilly next time.

Tested on Windows 7.

To configure a Windows computer to execute a login script whenever anybody logs in to the machine, you can you use the Local Group Policy Editor. From the command prompt or “Search programs and file”, launch the Local Group Policy Editor by entering gpedit.msc. Then, navigate to User Configuration\Windows Settings\Script (Logon/Logoff). Double click Logon, and add the script. Note: you can use PowerShell scripts as well, but do that under the PowerShell Scripts tab so the correct command line interpreter is used. Also, if you have user specific portions of the script, you should construct the logic of your script as such. The Logoff option works the same way.

Return top