< Back

Install-CGroup

Sun Jan 12, 2020 10:15 pm

NAME Install-CGroup



SYNOPSIS

Creates a new local group, or updates the settings for an existing group.





SYNTAX

Install-CGroup [-Name] <String> [[-Description] <String>] [[-Member] <String[]>] [-PassThru] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

`Install-CGroup` creates a local group, or, updates a group that already exists.



YOu can get a `System.DirectoryServices.AccountManagement.GroupPrincipal` object representing the group returned

to you by using the `PassThru` switch. This object implements the `IDisposable` interface, which means it uses

external resources that don't get garbage collected. When you're done using the object, make sure you call

`Dispose()` to free those resources, otherwise you'll leak memory. All over the place.





PARAMETERS

-Name <String>

The name of the group.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

A description of the group.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Member <String[]>

Members of the group.



Required? false

Position? 3

Default value @()

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Return the group as a `System.DirectoryServices.AccountManagement.GroupPrincipal`.



This object uses external resources that don't get cleaned up by .NET's garbage collector. In order to avoid

memory leaks, make sure you call its `Dispose()` method when you're done with it.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.DirectoryServices.AccountManagement.GroupPrincipal





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Install-CGroup -Name TIEFighters -Description 'Users allowed to be TIE fighter pilots.' -Members

EMPIRE\\Pilots,EMPIRE\\DarthVader



If the TIE fighters group doesn't exist, it is created with the given description and default members. If it

already exists, its description is updated and the given members are added to it.











RELATED LINKS





Name : Install-IisApplication

Category : Alias

Synopsis : Install-CIisApplication

Component :

Role :

Functionality :





Name : Install-IisAppPool

Category : Alias

Synopsis : Install-CIisAppPool

Component :

Role :

Functionality :





Name : Install-IisVirtualDirectory

Category : Alias

Synopsis : Install-CIisVirtualDirectory

Component :

Role :

Functionality :





Name : Install-IisWebsite

Category : Alias

Synopsis : Install-CIisWebsite

Component :

Role :

Functionality :