Udostępnij za pośrednictwem


Grant-CsOUPermission

 

Topic Last Modified: 2012-03-23

Grants Microsoft Lync Server 2010 management rights on an Active Directory organizational unit (OU).

Syntax

Grant-CsOUPermission -ObjectType <User | Computer | InetOrgPerson | Contact | AppContact | Device> -OU <String> [-Confirm [<SwitchParameter>]] [-Domain <Fqdn>] [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-GlobalCatalog <Fqdn>] [-Report <String>] [-WhatIf [<SwitchParameter>]]

Detailed Description

If you have locked down your Active Directory domain (that is, if you have disabled permission inheritance) then the domain preparation that takes place when you install Lync Server 2010 will not be able to add the rights needed to manage users, computers, contacts, application contacts, and InetOrg persons. (Domain administrators will still be able to manage these objects, but no one else, including members of the RTCUniversalUserAdmins group, will have management rights.) In that case, you will need to use the Grant-CsOUPermission cmdlet to give the required security groups the required rights. This must be done on a container-by-container basis.

Note that this cmdlet only grants rights to a set of predefined security groups; the cmdlet cannot be used to grant rights to arbitrary security groups or to individual users.

Rights granted by using Grant-CsOUPermission can later be removed by using Revoke-CsOUPermission. If you run that cmdlet, then the groups initially granted the OU rights will no longer have those Lync Server management rights for the specified Active Directory container. In that case, you will need to be an enterprise administrator or a domain administrator in order to manage Lync Server or one of its components.

Who can run this cmdlet: You must be a domain administrator in order to run the Grant-CsOUPermission cmdlet locally. To return a list of all the role-based access control (RBAC) roles this cmdlet has been assigned to (including any custom RBAC roles you have created yourself), run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets –match "Grant-CsOUPermission"}

Parameters

Parameter Required Type Description

ObjectType

Required

String

Type of object covered by these rights. Valid values are:

User

Computer

Contact

AppContact

InetOrgPerson

To assign multiple object types in the same command, separate the object types by using commas: -ObjectType "user","computer","contact".

OU

Required

Active Directory distinguished name

Distinguished name of the OU where rights are to be granted. For example: -OU "ou=Redmond,dc=litwareinc,dc=com".Note that you can only grant rights to a single OU per command.

Domain

Optional

String

Name of the domain where the OU is located. If this parameter is not included, then Grant-CsOUPermission will look for the OU on the current domain.

DomainController

Optional

String

Enables administrators to specify the fully qualified domain name (FQDN) of the domain controller to be used when running Grant-CsOUPermission. If not specified, the cmdlet will use the first available domain controller.

GlobalCatalog

Optional

String

FQDN of a global catalog server in your domain. This parameter is not required if you are running Grant-CsOUPermission on a computer with an account in your domain.

Force

Optional

Switch Parameter

Suppresses the display of any non-fatal error message that might occur when running the command.

Report

Optional

String

Enables you to specify a file path for the log file created when the cmdlet runs. For example: -Report "C:\Logs\OUPermissions.html"

WhatIf

Optional

Switch Parameter

Describes what would happen if you executed the command without actually executing the command.

Confirm

Optional

Switch Parameter

Prompts you for confirmation before executing the command.

Input Types

None. Grant-CsOUPermission does not accept pipelined input.

Return Types

Grant-CsOUPermission does not return any objects or values.

Example

-------------------------- Example 1 ------------------------

Grant-CsOUPermission -OU "ou=Redmond,dc=litwareinc,dc=com" -ObjectType "user"

The command shown in Example 1 grants user management rights (-ObjectType "user") to the Redmond OU in the domain litwareinc.com.

-------------------------- Example 2 ------------------------

Grant-CsOUPermission -OU "ou=Redmond,dc=litwareinc,dc=com" -ObjectType "user","contact","inetOrgPerson"

In Example 2, management rights are granted for three different objects (user, contact, inetOrgPerson) for the Redmond OU in the domain litwareinc.com.

-------------------------- Example 3 ------------------------

$x = "ou=Redmond,dc=litwareinc,dc=com", "ou=Dublin,dc=litwareinc,dc=com", "ou=Tokyo,dc=litwareinc,dc=com"

foreach ($i in $x) {Grant-CsOUPermission -OU $i -ObjectType "user"}

In the preceding example, user management rights are simultaneously granted for three different OUs: Redmond, Dublin, and Tokyo. To carry out this task, the first command in the example creates an array variable named $x; this variable holds the distinguished names of the three Active Directory OUs where rights will be granted. In the second command, a foreach loop is created that takes each OU stored in the array and runs the Grant-CsOUPermission cmdlet against that organizational unit. In turn, that command grants user management rights for each OU in the array.

See Also

Other Resources

Revoke-CsOUPermission
Test-CsOUPermission