Author | external help file | Module Guid | Module Name | online version | schema |
---|---|---|---|---|---|
Paul Boyer |
psvault-ActiveDirectory-help.xml |
66f0b290-a051-4b8e-be84-b0a280c74a50 |
psvault-ActiveDirectory |
2.0.0 |
Script to disable AD users without deleting their accounts
Disable-Users [[-TargetOU] <ADOrganizationalUnit>] [-Usernames] <String[]> [[-LogFile] <String>]
[<CommonParameters>]
Script takes in a String[] of usernames and disables each user. Optionally, the script can move users to an new OU
Disable-Users -Usernames "bgates" -LogFile "C:\Log.txt"
An [Microsoft.ActiveDirectory.Management.ADOrganizationalUnit] object representing the new OU that disabled users should be moved to
Type: ADOrganizationalUnit
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
String array of usernames that will be disabled by the script
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
String path to the log file that results should be saved to.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
requires -Modules ActiveDirectory