Re: Remove a Group
From: Mark-Allen Perry (mark-allen_at_mvps_dot_org)
Date: 09/22/04
- Next message: Mark-Allen Perry: "Re: Help with Local Groups"
- Previous message: Adam: "tasklist.exe"
- In reply to: Keith: "Remove a Group"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Sep 2004 20:52:59 +0200
Check: http://www.15seconds.com/issue/011127.htm
I believe you'd use '.Remove'
Keep us informed on this, please. I'd like to know also.
-- And always try the MS KB first before posting. The answer is probably already posted. MS KB: http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO ---- Mark-Allen Perry ALPHA Systems Marly, Switzerland mark-allen_AT_mvps_DOT_org "Keith" <@.> wrote in message news:ey1o$2KoEHA.592@TK2MSFTNGP11.phx.gbl... How can I remove a domain group from a local group? I have used the code below to add a specific domain group to the local admin group on every machine the code is run on How can I now do the reverse and remove the group from any machine the code is run on? '--------------------8<---------------------- Set oWshNet = CreateObject("WScript.Network") sGroup = "Hanlon" sNetBIOSDomain = oWshNet.UserDomain sComputer = oWshNet.ComputerName Set oGroup = GetObject("WinNT://" & sComputer & "/Administrators,group") Set oUser = GetObject("WinNT://" & sNetBIOSDomain & "/" & sGroup & ",group") ' suppress errors in case the user is already a member On Error Resume Next oGroup.Add(oUser.ADsPath) On Error Goto 0 '--------------------8<----------------------
- Next message: Mark-Allen Perry: "Re: Help with Local Groups"
- Previous message: Adam: "tasklist.exe"
- In reply to: Keith: "Remove a Group"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|