here is some sample code to demo how you might automate the process. Shows how to add and delete from the local admins group.
[script]
'==========================================================================
'
' NAME: AddUserToLocalAdminGroup.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL:
' DATE : 8/8/2004
'
' COMMENT: <comment>
'
'==========================================================================
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
'Edit the next line with your domain name
DomainString = "DomainName"
UserString = WSHNetwork.UserName
'Add the user to the local admins group
Call WSHShell.Run("cmd.exe /C net localgroup administrators " & DomainString & "\" & UserString & " /add")
'Remove the user from the local admins group
Call WSHShell.Run("cmd.exe /C net localgroup administrators " & DomainString & "\" & UserString & " /delete")
[/script]
I hope you find this post helpful. Please let me know if it was.
Regards,
Mark