Re: Group Policy questions



Thanks that worked sortof. I am trying to get usernames to be added to
powerusers local group. I didnt want to use groups, but I figured I'd try
using domain users as all the users are part of that. Unfortuneatly, this
will not work as a logon script as when run twice, it throws up a windows
scripting error telling me that the group already exsists with those
premissions. Are you able to pass a -quiet or -ignore errors command to
windows scripting so that it will supress the error message?

i wish to use it in the logon script area but if it throws up errors that
isnt good.


"VMM" <VMM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C5CCF991-4434-459B-A234-C5F01E4404B3@xxxxxxxxxxxxxxxx
> Hi Carl O,
>
> Sorry Carl, my mistake for not add any comments in code.
>
> Assume the follwing cenario:
>
> Domain name = XPTO
> Domain Global Security Group = ITTechnicians
>
> Purpose = add ITTechnicians Domain Group to Administrators Local Group
> '-------------------------------------------------------------
> Set wshNetwork = CreateObject("WScript.Network")
> ComputerName= wshNetwork.ComputerName
>
> localstr="WinNT://" & Computername
>
> 'Get domain group and assigned to ITTechs Variable
> ITTechs="WinNT://XPTO/ITTechnicians"
>
> 'Add Domain Group to Administrators Local Group
> AddToGroup ITTechs, "Administrators"
>
> Function AddToGroup(member, Grpname)
>
> Dim grp1
> Set grp1 = Getobject(localstr&"/"& Grpname,group)
> grp1.Add (member)
>
> End Function
> '-------------------------------------------------------------
>
> Please let me know if you have some questions.
>
> Regards,


.



Relevant Pages

  • Re: Group Policy questions
    ... supresses errors. ... > will not work as a logon script as when run twice, ... >> Purpose = add ITTechnicians Domain Group to Administrators Local Group ... >> 'Get domain group and assigned to ITTechs Variable ...
    (microsoft.public.windows.group_policy)
  • Re: How to configure local PC group membership via Group Policy?
    ... key the name of the Domain group you ... want to added to the local group. ... Don't put anything in the "Members of this group" box. ... > First is Add Group (I'm assuming I need to create a security group ...
    (microsoft.public.windows.group_policy)
  • Re: Adding Domain User to local PC
    ... ' Specify AdsPath of domain group to be added to ... ' Bind to domain group. ... ' Bind to local group. ...
    (microsoft.public.windows.server.scripting)
  • Re: Remove a Group
    ... How can I remove a domain group from a local group? ... sComputer = oWshNet.ComputerName ... ' suppress errors in case the user is already a member ...
    (microsoft.public.windows.server.scripting)