/build/static/layout/Breadcrumb_cap_w.png

Prompt for AD account to add to local admin group

I've been using the standard "join_domain.vbs" script on my K2000 as a post install task for adding systems to the domain, which works fine.  I'd like to improve my post install by prompting for the users AD account name and adding that name to the local administrators group. Is there an easy way to add this to the join domain script?  I see there are quite a few examples of adding a user account to the local admin group but I don't see any specifying prompting.  In the worst case if I could pre-populate the local admin group with the account of a local AD admin in that location that would work as well.  Appreciate any help.  Just getting into scripting so excuse the remedial nature of the post :)

Ken-

0 Comments   [ + ] Show comments

Answers (3)

Posted by: ambrish7 6 years ago
White Belt
1
You may find it easier to use GPO instead of scripting for this, that way you control centrally who gets added by way of OU etc.
Posted by: anonymous_9363 6 years ago
Red Belt
1
Dim dicLocalAdminGroupMembers
Dim objUser
Dim blnReturnValue

For Each objUser In dicLocalAdminGroupMembers
MsgBox "This is a spectacularly BAD idea."    
blnReturnValue = RemoveFromLocalAdminGroup(objUser)    
If blnReturnValue Then        
MsgBox "Phew!    
End If
Next
Posted by: kenrinc 6 years ago
Senior Yellow Belt
1
I get it.  But if I go with a GPO, I still have to have a way to get the system in the proper OU during the deploy.  These are for remote sites that don't have local IT support. So maybe I should use this to do the add OU portion?
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ