Jump to content
Mathias Gindler

ANSWERED (solved) Benutzer aus Gruppe entfernen

Recommended Posts

Hallo zusammen,

 

ich bräuchte eine Möglichkeit, über Powershell alle Mitglieder einer Gruppe aus dieser zu entfernen - es wäre nett, wenn mir hier jemand kurz unter die Arme greifen könnte 🙂

 

Vielen Dank und schöne Feiertage!

Edited by Mathias Gindler

Share this post


Link to post
Share on other sites
PS C:\Windows\system32> get-help -full Remove-IpPbxGroupMember

NAME
    Remove-IpPbxGroupMember
    
ÜBERSICHT
    Removes user from group.
    
    
SYNTAX
    Remove-IpPbxGroupMember [-GroupEntry <GroupEntry>] [-UserEntry <Object>] [-UserName <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
    
    Remove-IpPbxGroupMember [-GroupName <String>] [-UserEntry <Object>] [-UserName <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
    
    
BESCHREIBUNG
    The Remove-IpPbxGroupMember cmdlet removes a user from a group.
    
    If no user is specified all users are removed from a group.
    

PARAMETER
    -GroupEntry <GroupEntry>
        [GroupEntry] object where the user should be removed.
        
        Erforderlich?                false
        Position?                    named
        Standardwert                 
        Pipelineeingaben akzeptieren?true (ByValue)
        Platzhalterzeichen akzeptieren?false
        
    -GroupName <String>
        Name of the group where the user should be removed.
        
        Erforderlich?                false
        Position?                    named
        Standardwert                 
        Pipelineeingaben akzeptieren?false
        Platzhalterzeichen akzeptieren?false
        
    -UserEntry <Object>
        [UserEntry] or [UserAdminView1Entry] of the user who should be removed.
        
        Erforderlich?                false
        Position?                    named
        Standardwert                 
        Pipelineeingaben akzeptieren?false
        Platzhalterzeichen akzeptieren?false
        
    -UserName <String>
        Name of the user who should be removed.
        
        Erforderlich?                false
        Position?                    named
        Standardwert                 
        Pipelineeingaben akzeptieren?false
        Platzhalterzeichen akzeptieren?false
        
    -WhatIf [<SwitchParameter>]
        
        Erforderlich?                false
        Position?                    named
        Standardwert                 
        Pipelineeingaben akzeptieren?false
        Platzhalterzeichen akzeptieren?false
        
    -Confirm [<SwitchParameter>]
        
        Erforderlich?                false
        Position?                    named
        Standardwert                 
        Pipelineeingaben akzeptieren?false
        Platzhalterzeichen akzeptieren?false
        
    <CommonParameters>
        Dieses Cmdlet unterstützt folgende allgemeine Parameter: "Verbose", "Debug",
        "ErrorAction", "ErrorVariable", "WarningAction", "WarningVariable",
        "OutBuffer", "PipelineVariable" und "OutVariable". Weitere Informationen finden Sie unter 
        "about_CommonParameters" (http://go.microsoft.com/fwlink/?LinkID=113216). 
    
EINGABEN
    [GroupEntry] $GroupEntry
    [string] $GroupName
    
    
AUSGABEN
    None
    
    
    -------------------------- BEISPIEL 1 --------------------------
    
    PS C:\>Remove-IpPbxGroupMember -GroupName "MyTestGroup" -UserName "Sebastian"
    
    Removes user "Sebastian" from group "MyTestGroup".
    
    
    
    
    -------------------------- BEISPIEL 2 --------------------------
    
    PS C:\>Remove-IpPbxGroupMember -GroupName "MyTestGroup"
    
    Removes all users from "MyTestGroup".
    
    
    
    
    -------------------------- BEISPIEL 3 --------------------------
    
    PS C:\>Get-IpPbxGroup -GroupName "MyTestGroup" | Remove-IpPbxGroupMember -UserName "Sebastian"
    
    Removes user "Sebastian" from group "MyTestGroup".
    
    
    
    
    -------------------------- BEISPIEL 4 --------------------------
    
    PS C:\>Get-IpPbxGroup -GroupName "MyTestGroup" | Remove-IpPbxGroupMember
    
    Removes all users from "MyTestGroup".
    
    
    
    
    -------------------------- BEISPIEL 5 --------------------------
    
    PS C:\>Get-IpPbxGroup | Remove-IpPbxGroupMember -UserName "Sebastian"
    
    Removes user "Sebastian" from all groups.
    
    
    
    
    -------------------------- BEISPIEL 6 --------------------------
    
    PS C:\>Get-IpPbxGroup | Remove-IpPbxGroupMember
    
    Removes all users from all groups.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.