Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows Server 2003/2008 Logon scripts

Posted on 2011-09-20
8
Medium Priority
?
272 Views
Last Modified: 2012-05-12
I would like to know, is there a way to bypass logon scripts either for the administrator or for the servers?
0
Comment
Question by:schmad01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 5

Expert Comment

by:neothwin
ID: 36571395
For Administrators (or user accounts), you can remove logon script in AD.
If you want to skip the script on the servers, you can add some logics in the script. Normally these are conditional checking and jump statements (e.g. goto in batch script)

e.g.1
Let's say your server names are SERVER01, SERVER02, and so on and to skip running script on these servers in batch script:

==========
if /i "%computername:~0,6%"=="SERVER" goto END
.
.
your script body here
.
.
:END
==========

e.g.2
To skip only a server called ServerA:
if /i "%computername%"=="SERVERA" goto END
0
 

Author Comment

by:schmad01
ID: 36571426
I tried that with the below script, but it doesn't seem to be working for administrator.


Echo Please wait.....Preparing Logon Scripts
If "%username%" == "ofcstaff" GOTO ofcstaff
If "%username%" == "ralf" GOTO End
If "%username%" == "administrator" GOTO Admin
If "%username%" == "Administrator" GOTO Admin
If "%username%" == "benchmark" GOTO Admin
If "%computername%" == "MCBDC1" GOTO End
If "%computername%" == "MCBMS1" GOTO mcbms1
If "%computername%" == "2003-server" GOTO End
If "%computername%" == "main" GOTO End
If "%computername%" == "WORK-SERVER" GOTO End
If "%computername%" == "ralf-1" GOTO Admin
If "%computername%" == "ralf-2" GOTO Admin
If "%computername%" == "Station-5" GOTO End

REM --- DO EVERYTHING HERE
MCBdefault.bat
REM --- ETC
REM --- ETC

:ofcstaff
net use k: \\mcbdc1\clients /persistent:No


:Admin

net use y: \\mcbdc1\installs /persistent:No


:mcbms1
printerdefault.vbs
0
 
LVL 5

Accepted Solution

by:
neothwin earned 2000 total points
ID: 36572209
pls use /i in if commands to use case insensitive.
And pls ensure logon script property is configured on Administrator user account.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:schmad01
ID: 36578357
Interesting, I've never seen that /i before.  What do you mean exactly in your second sentence.
0
 

Author Comment

by:schmad01
ID: 36599532
What do you mean by ensure logon script property is configured on Administrator user account? Thanks.
0
 
LVL 5

Expert Comment

by:neothwin
ID: 36713963
The Administrator account is domain account? or local account? Pls check the logon script is configured on domain\administrator or local administrator account.
0
 

Author Comment

by:schmad01
ID: 36906336
Yes, domain account.
0
 

Author Closing Comment

by:schmad01
ID: 37006291
Thanks alot.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question