Remove-DSUser
Synopsis
Delete a user.
Syntax
__AllParameterSets
Remove-DSUser -UserID <guid> [-AsLegacyResponse] [<CommonParameters>]Description
Delete a user specified by the ID attribute. The deleted user can be restored from the web UI or from Restore-DSDeletedUser.
Examples
Example 1
PS C:\> Remove-DSUser -UserID '3c5d7e8f-9a1b-4c2d-8e3f-4a5b6c7d8e9f'Soft-delete a user (can be restored later)
Example 2
PS C:\> Remove-DSUser -UserID $userId
PS C:\> Remove-DSDeletedUser -ID $userIdPermanently delete a user (cannot be undone). Must soft-delete first, then hard-delete.
Parameters
-AsLegacyResponse
In versions prior to 2024.2, many DS cmdlets returned a ServerResponse object. Enabling this backward compatibility switch allows scripts developed for earlier versions to function correctly.
-UserID
ID of the user to delete.
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.
Outputs
RemoteDesktopManager.PowerShellModule.Private.ServerResponse
Notes
For more information, type "Get-Help Remove-DSUser -detailed". For technical information, type "Get-Help Remove-DSUser -full".
Last updated
Was this helpful?