General discussion


Disable logon scripts just for servers?

By truwarrior22 ·
I have a logon script for when I logon to workstations, that basically maps drives. Is there away with a policy to disable the logon script for when I logon to any server domain controller? I have a mix of windows 2000 and 2003 domain controllers.

Thanks in advance!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

set up a domain admin type account for use on servers.

by X-MarCap In reply to Disable logon scripts jus ...

Set up as a local administrator on the box for the one where you map the world, or maybe less authority. Maybe, power user is enough for non-admin tasks.

Set up the domain admin accounts disable the administrator account and depending upon how many servers you have, set up local admin accounts.
if your initials are xyz
admLxyz admDxyz, etc...

Good luck


Collapse -

Just a thought

by truwarrior22 In reply to set up a domain admin typ ...

I guess I could add a statement in the logon script with an IF statement or something. Like IF hostname = server1 or server2 then skip to end etc...

Any thoughts on that?

Collapse -

Or you could

by thefrown In reply to Just a thought

Create a text file (with the same name) on the C: of each server. Then put in your logon script an 'if exist' (followed by full path and name of file in quotes) and 'goto' clause to skip your drive mappings.

Alternatively, create an administrative domain account for use whilst working on servers that has no login script applied to it. Then remove the administrative rights to your normal account that you use for email, word processing etc. (this is actually what Microsoft recommend)

Collapse -

It might be simpler to change the script...

by sam spade In reply to Disable logon scripts jus ...

WMI can be used to determine if you have logged onto a workstation, member server, domain controller, etc. So if its not a workstation you could just quit before mapping drives.

Below is some code taken from a Hey, Scripting Guy! article to give you the general idea. The full article is here ->

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colComputers = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer in colComputers
If objComputer.DomainRole < 2 Then
Wscript.Echo "This is a workstation."
Wscript.Echo "This is a server."
End If

Related Discussions

Related Forums