Set-QADComputer
From PowerGUI Wiki
Make changes to a computer object in Active Directory Domain Services.
This cmdlet is part of the Quest ActiveRoles Server product. Use Get-QARSProductInfo to view information about ActiveRoles Server.
Contents |
Syntax
Set-QADComputer [-Identity] <IdentityParameter> [-Connection <ArsConnection>] [-ConnectionAccount <string>] [-ConnectionPassword <SecureString>] [-Control <hashtable>] [-Credential <PSCredential>] [-Description <string>] [-DeserializeValues] [-DisplayName <string>] [-ExcludedProperties <string[]>] [-IncludedProperties <string[]>] [-Location <string>] [-ManagedBy <IdentityParameter>] [-ObjectAttributes <ObjectAttributesParameter>] [-Password <string>] [-Proxy] [-SamAccountName <string>] [-SecondaryOwner <UpdateIdentityParameter[]>] [-Service <string>] [-TrustForDelegation <Boolean>] [-UseDefaultExcludedProperties <Boolean>] [-UseGlobalCatalog] [-Confirm] [-WhatIf] [<CommonParameters>]
Detailed Description
Use this cmdlet to modify properties of an Active Directory computer object. You can modify some commonly used computer properties by using the corresponding cmdlet parameters. Properties that are not associated with cmdlet parameters can be modified by using the ObjectAttributes parameter. Thus, to modify the value of the 'description' or 'displayName' attribute, you can use the -Description or -DisplayName parameter, respectively. If a particular attribute is referred to by both the ObjectAttributes array and an attribute-specific parameter, the ObjectAttributes setting has no effect on that attribute. The cmdlet sets the attribute to the value specified by the attribute-specific parameter.
The cmdlet has optional parameters that determine the server and the security context for the operation. Normally, the connection parameters could be omitted so far as a connection to a server is established prior to using the cmdlet. In this case, the server and the security context are determined by the Connect-QADService cmdlet.
If you do not use Connect-QADService and have no connection established prior to using a cmdlet, then the connection settings, including the server and the security context, are determined by the connection parameters of the first cmdlet you use. Subsequent cmdlets will use those settings by default.
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
| Connection | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| ConnectionAccount | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| ConnectionPassword | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| Control | Use this parameter to pass request controls (in-controls) to ActiveRoles Server as part of an operation request. In ActiveRoles Server, request controls are used to send extra information along with an operation request, to control how ActiveRoles Server performs the request.
The parameter value is a hash table that defines the names and values of the request controls to be passed to ActiveRoles Server. The parameter syntax is as follows: -Control @{<name> = <value>; [<name> = <value>] ...}
In this syntax, each of the name-value pairs is the name and the value of a single control. For instructions on how to create and use hash tables, see topic "about_associative_array" or "about_hash_tables" in Windows PowerShell Help. For information about ActiveRoles Server request controls, refer to ActiveRoles Server SDK documentation. Note that this parameter only has an effect on the operations that are performed through ActiveRoles Server (connection established using the Proxy parameter); otherwise, this parameter causes an error condition in ActiveRoles Management Shell. | false | false | |
| Credential | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| Description | Set or clear the 'description' attribute. | false | false | |
| DeserializeValues | Supply this parameter on the command line if the input you pass to the cmdlet contains serialized attribute values (for instance, when importing a directory object from a text file that was created using the Serialize parameter). For examples of how to export and import an object, see help on the Get-QADUser cmdlet. | false | false | |
| DisplayName | Set or clear the 'displayName' attribute. | false | false | |
| ExcludedProperties | Use this parameter to specify the attributes that you do not want the cmdlet to update in the directory. Supply a list of the attribute LDAP display names as the parameter value. You could use this parameter when importing attribute values from a text file, in order to prevent some attributes found in the file from being set in the directory. | false | false | |
| Identity | Specify the Distinguished Name (DN), Canonical Name, GUID or, if applicable, the Domain\Name, UPN or SID of the object you want the cmdlet to act upon. The cmdlet makes changes to, or otherwise manages, the object identified by this parameter value. When you pipe an object into the cmdlet, this parameter is used to receive the object. | true | true (ByValue) | |
| IncludedProperties | Use this parameter to specify explicitly the attributes that you want the cmdlet to update in the directory. Supply a list of the attribute LDAP display names as the parameter value. When used together with UseDefaultExcludedProperties, this parameter allows you to have the cmdlet update some attributes that would not be updated otherwise.
Note: If a particular attribute is listed in both ExcludedProperties and IncludedProperties, the cmdlet does not set the value of that attribute the directory. | false | false | |
| Location | Set the 'location' attribute to this parameter value. | false | false | |
| ManagedBy | Specify the DN, SID, GUID, UPN or Domain\Name of the user or group to be set as the 'managedBy' attribute value on the object in the directory. | false | false | |
| ObjectAttributes | Specify an associative array that defines the attributes to set. The array syntax:
@{attr1='val1';attr2='val2';...} In this syntax, each of the key-value pairs is the LDAP display name and the value of an attribute to set. Thus, passing the @{title='Associate';l='Paris'} array to the ObjectAttributes parameter causes the cmdlet to set the 'Job Title' attribute to 'Associate' and the 'City' attribute to 'Paris'. For information about associative arrays, type the following command at the PowerShell command-prompt: help about_associative_array | false | true (ByValue, ByPropertyName) | |
| Password | Not Specified | false | false | |
| Proxy | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| SamAccountName | Set the 'sAMAccountName' attribute (pre-Windows 2000 name) to this parameter value. | false | false | |
| SecondaryOwner | Use this parameter to add or remove secondary owners. Parameter value can be a string array or an associative array that specifies the identifiers, such as DN, SID, GUID, UPN or Domain\Name, of one or more users or groups to add or remove from the secondary owner role. Some examples of possible parameter values are:
-SecondaryOwner 'domain\administrator','domain\user' Replace the existing identities in the secondary owners list with the identities specified. -SecondaryOwner @{append=@('domain\administrator','domain\user')} Add the specified identities to the secondary owners list, without removing the existing owners. -SecondaryOwner @{delete=@('domain\administrator','domain\user')} Remove the specified identities from the secondary owners list, leaving the other owners intact. -SecondaryOwner $null Clear the secondary owners list, so that no secondary owners are specified. This parameter has an effect only in conjunction with the Proxy connection parameter because secondary owner settings are stored and managed by ActiveRoles Server. | false | false | |
| Service | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| TrustForDelegation | Supply the parameter value of $true or $false depending on whether or not you want to configure the computer object so that the computer is trusted for delegation. When a computer is trusted for delegation, any service running under the Local System account on that computer can access resources on other computers and impersonate its clients when accessing resources on other computers. | false | false | |
| UseDefaultExcludedProperties | When set to 'true', this parameter causes the cmdlet not to update a certain pre-defined set of attributes in the directory. This pre-defined set of attributes (referred to as "default excluded properties") can be viewed or modified by using the Get-QADPSSnapinSettings or Set-QADPSSnapinSettings cmdlet, respectively. | false | false | |
| UseGlobalCatalog | For parameter description, see help on the Connect-QADService cmdlet. | false | false | |
| Confirm | Prompts you for confirmation before executing the command. | false | false | |
| WhatIf | Describes what would happen if you executed the command without actually executing the command. | false | false |
Examples
EXAMPLE 1
Set-QADComputer 'lab.local/computers/Comp4' -Location 'AMS/HQ/Building A'
Description
Modify the location for a given computer.
EXAMPLE 2
Set-QADComputer 'lab.local/computers/Comp4' -ManagedBy 'domainName\logonName'
Description
Set the 'managedBy' attribute value for a given computer using the pre-Windows 2000 logon name of the user.
EXAMPLE 3
Set-QADComputer 'lab.local/computers/Comp4' -objectAttributes @{servicePrincipalName=@('MSSQLSvc/Comp4.lab.local:1362','ldap/Comp4.lab.local:389')}
Description
Replace the SPN values for a given computer.
EXAMPLE 4
Set-QADComputer 'lab.local/computers/Comp4' -objectAttributes @{servicePrincipalName=@{Append=@('MSSQLSvc/Comp4.lab.local:1362','ldap/Comp4.lab.local:389')}}
Description
Add two new items to the SPN values for a given computer.
