Solved

Need an NT command line script/batch file to report all domain users with no logon script configured

Posted on 2004-07-31
2
329 Views
Last Modified: 2010-04-11
I need an NT command line script/batch file to report all domain users with no logon script configured. Even better, another one to update them with the right logon script in bulk
0
Comment
Question by:cmitch2000
[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
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
TheKenman earned 500 total points
ID: 11685344
Try this (might need minor tweaking):

sDomain = InputBox("Enter Domain to update:", "ENTER DOMAIN")
updLoginScript sDomain

'helper fn()'s
' hides the crucial IWAM_ abd IUSR_ accounts
' to prevent accidental catastrophe
Function notCrucial(sObj)
      sObj = UCase(Left(sObj,5))
      If sObj = "IWAM_" Or sObj = "IUSR_" Then
            notCrucial = FALSE
      Else
            notCrucial = TRUE
      End If
End Function

'return FALSE if input is not valid
Function notEmpty(obj)
   Select Case obj
      Case "" : notEmpty = FALSE
      Case isEmpty(obj) : notEmpty = FALSE
      Case isNull(obj) : notEmpty = FALSE
      Case Else : notEmpty = TRUE
   End Select
End Function

'MAIN()
Function updLoginScript(strDomain)
      On Error Resume Next
      Set oDom = GetObject("WinNT://" & strDomain)
      oDom.Filter = Array("user")
      If Err <> 0 Then
            updLoginScript = msgbox "Bad Domain!!\n\nDomain: " & strDomain
      Exit Function
      Else
      For Each oUser in oDom
         If notCrucial(oUser.Name) Then
            If notEmpty(oUser.LoginScript) Then
               oUser.LoginScript = "Login script file name"
               oUser.SetInfo  
            End If
         End If
      Next
      End If
      Set GroupObj = Nothing
      If Err <> 0 Then
      msgbox("Script completed with errors.")
         updLoginScript = FALSE      
   Else
      msgbox("Script successfully completed.")
         updLoginScript = TRUE      
   End If
End Function
0
 
LVL 7

Expert Comment

by:TheKenman
ID: 11701266
Thanks :)
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

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.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

751 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