The first command gets a Run As account for Workflow Account by using the Get-SCSMRunAsAccount cmdlet.
The command stores the result in the $RunAsAccount variable.
The second command prompts you for credentials by using the Get-Credential cmdlet, and then stores the credentials in the $Credential variable.
The final command creates an Active Directory connector to the local domain, which retrieves all computers, printers, users, and user groups.
The connector is configured to synchronize every Sunday at 3:00 A.M.
Example 2: Create a connector to the local domain that includes a user filter
The first command gets a Run As account for Workflow Account, and then stores it in the $RunAsAccount variable.
The second command prompts you for credentials by using the Get-Credential cmdlet, and then stores the credentials in the $Credential variable.
The final command creates an Active Directory connector to the local domain which retrieves only the user accounts that start with the letter E.
Parameters
-ADCredential
Specifies the credential to use when this cmdlet connects to the domain controller.
Parameter properties
Type:
System.Management.Automation.PSCredential
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ComputerFilter
Specifies a filter that selects the computers that the connector synchronizes.
The filter must be specified as an Active Directory filter.
For example, the following filter includes all computers which begin with win in the synchronization:
(name=win*)
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ComputerName
Specifies the name of the computer on which the System Center Data Access service runs.
The user account that is specified in the Credential parameter must have access rights to the specified computer.
Parameter properties
Type:
System.String[]
Default value:
Localhost
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
System.Management.Automation.SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Credential
Specifies the credentials that this cmdlet uses to connect to the server on which the System Center Data Access service runs.
The specified user account must have access rights to that server.
Parameter properties
Type:
System.Management.Automation.PSCredential
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Description
Specifies a description for the connector.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
1
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DisplayName
Specifies the display name property of the connector.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
0
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Enable
Indicates whether this cmdlet enables or disables the connector.
Parameter properties
Type:
System.Boolean
Default value:
True
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ExpandGroups
Specifies that this cmdlet recursively includes members of the groups that are specified by the UserFilter parameter.
Parameter properties
Type:
System.Management.Automation.SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PassThru
Indicates that this cmdlet returns the Active Directory connector that it creates.
You can pass this object to other cmdlets.
Parameter properties
Type:
System.Management.Automation.SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PrinterFilter
Specifies a filter that this cmdlet uses to select the printers that the connector synchronizes.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-QueryRoot
Specifies the Active Directory folder from which this cmdlet queries objects, such as LDAP://DC=scsm,DC=stbtest,DC=microsoft,DC=com.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
2
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-RunAsAccount
Specifies the RunAs account to use when using this connector.
Causes the Active Directory connector to start a synchronization cycle.
Parameter properties
Type:
System.Management.Automation.SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-UserFilter
Specifies the filter that is used to select the users to by synchronized by the connector.
You must specify the value in the form of an Active Directory filter.
For example, the following value for this parameter includes in the synchronization users whose givenName starts with a:
(givenname=a*)
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type:
System.Management.Automation.SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.