< Back
Get-UserProfile
Post
NAME Get-UserProfile
SYNOPSIS
The Get-UserProfile module list or remove User Profiles from local or remote computer. List with Active Directory
SearchBase.
SYNTAX
Get-UserProfile [[-ComputerName] <String[]>] [-LocalPath <String>] [-SID <String>] [-Loaded <String>] [-Roaming
<String>] [-Special <String>] [-Days <Int32>] [-Remove] [-TestWinRM] [-Force] [<CommonParameters>]
Get-UserProfile [-ADSearchBase <String>] [-LocalPath <String>] [-SID <String>] [-Loaded <String>] [-Roaming
<String>] [-Special <String>] [-Days <Int32>] [-Remove] [-TestWinRM] [-Force] [<CommonParameters>]
DESCRIPTION
The Get-UserProfile module list or remove User Profiles from local or remote computer. List with Active Directory
SearchBase.
PARAMETERS
-ComputerName <String[]>
Name of computer to list User Profiles from local or remote computer.
If use Parameter ComputerName, than Parameter ADSearchBase is disable.
Required? false
Position? 1
Default value localhost
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-ADSearchBase <String>
Active Directory SearchBase of computer to list User Profiles from local or remote computer.
If use Parameter ADSearchBase, than Parameter ComputerName is disable.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-LocalPath <String>
Filter for colum LocalPath.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-SID <String>
Filter for colum SID.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Loaded <String>
False or True filter for colum Loaded.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Roaming <String>
False or True filter for colum Roaming.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Special <String>
All or True filter for colum Roaming. Default is False.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Days <Int32>
Older than x days filter.
Required? false
Position? named
Default value 0
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Remove [<SwitchParameter>]
Remove User Profiles from local or remote computer. Default with Confirm.
To disable the SwitchParameter Confirm use Parameter Force.
Required? false
Position? named
Default value False
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-TestWinRM [<SwitchParameter>]
TestWinRM for Test-NetConnection with TCPPort WinRM.
Required? false
Position? named
Default value False
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Force [<SwitchParameter>]
Disable the built-in Format-Table, Sort-Object and SwitchParameter Confirm from Parameter Remove.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-UserProfile
List User Profiles from local computer with built-in Format-Table and Sort-Object.
ComputerName LastUseTime LocalPath Loaded Roaming Special UserName SID
------------ ----------- --------- ------ ------- ------- -------- ---
LOCALHOST C:\\Users\\test1 False False False NB01\\test1
S-1-5-21-913119323-3770826481-2848448841-1000
LOCALHOST 27.09.2018 10:25:56 C:\\Users\\test2 True False False NB01\\test2
S-1-5-21-913119323-3770826481-2848448841-1001
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2
List User Profiles on multiple remote computer with built-in Format-Table and Sort-Object.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-UserProfile -SearchBase "OU=Computers,DC=comodo,DC=com" with built-in Format-Table and Sort-Object.
List User Profiles on Active Directory SearchBase computer.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -Force
List User Profiles on multiple remote computer and disable the built-in Format-Table, Sort-Object and disable the
Confirm Switch from Parameter Remove.
-------------------------- EXAMPLE 5 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -LocalPath "test1"
List User Profile with wildcard filter for LocalPath on multiple remote computer.
-------------------------- EXAMPLE 6 --------------------------
PS C:\\>Get-UserProfile -LocalPath "test1" -Remove
Remove User Profiles with wildcard filter for LocalPath from local computer.
-------------------------- EXAMPLE 7 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -SID "S-1-5-21-913119323-3770826481-2848448841-1001" -Remove -Force
Remove User Profile with specific filter for SID on multiple remote computer
Disable the built-in Format-Table, Sort-Object and SwitchParameter Confirm from Parameter Remove.
-------------------------- EXAMPLE 8 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -Days 30 -Remove -Force
Remove User Profiles with older than x days filter on multiple remote computer.
Disable the built-in Format-Table, Sort-Object and SwitchParameter Confirm from Parameter Remove.
RELATED LINKS
SYNOPSIS
The Get-UserProfile module list or remove User Profiles from local or remote computer. List with Active Directory
SearchBase.
SYNTAX
Get-UserProfile [[-ComputerName] <String[]>] [-LocalPath <String>] [-SID <String>] [-Loaded <String>] [-Roaming
<String>] [-Special <String>] [-Days <Int32>] [-Remove] [-TestWinRM] [-Force] [<CommonParameters>]
Get-UserProfile [-ADSearchBase <String>] [-LocalPath <String>] [-SID <String>] [-Loaded <String>] [-Roaming
<String>] [-Special <String>] [-Days <Int32>] [-Remove] [-TestWinRM] [-Force] [<CommonParameters>]
DESCRIPTION
The Get-UserProfile module list or remove User Profiles from local or remote computer. List with Active Directory
SearchBase.
PARAMETERS
-ComputerName <String[]>
Name of computer to list User Profiles from local or remote computer.
If use Parameter ComputerName, than Parameter ADSearchBase is disable.
Required? false
Position? 1
Default value localhost
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-ADSearchBase <String>
Active Directory SearchBase of computer to list User Profiles from local or remote computer.
If use Parameter ADSearchBase, than Parameter ComputerName is disable.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-LocalPath <String>
Filter for colum LocalPath.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-SID <String>
Filter for colum SID.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Loaded <String>
False or True filter for colum Loaded.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Roaming <String>
False or True filter for colum Roaming.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Special <String>
All or True filter for colum Roaming. Default is False.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Days <Int32>
Older than x days filter.
Required? false
Position? named
Default value 0
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Remove [<SwitchParameter>]
Remove User Profiles from local or remote computer. Default with Confirm.
To disable the SwitchParameter Confirm use Parameter Force.
Required? false
Position? named
Default value False
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-TestWinRM [<SwitchParameter>]
TestWinRM for Test-NetConnection with TCPPort WinRM.
Required? false
Position? named
Default value False
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Force [<SwitchParameter>]
Disable the built-in Format-Table, Sort-Object and SwitchParameter Confirm from Parameter Remove.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-UserProfile
List User Profiles from local computer with built-in Format-Table and Sort-Object.
ComputerName LastUseTime LocalPath Loaded Roaming Special UserName SID
------------ ----------- --------- ------ ------- ------- -------- ---
LOCALHOST C:\\Users\\test1 False False False NB01\\test1
S-1-5-21-913119323-3770826481-2848448841-1000
LOCALHOST 27.09.2018 10:25:56 C:\\Users\\test2 True False False NB01\\test2
S-1-5-21-913119323-3770826481-2848448841-1001
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2
List User Profiles on multiple remote computer with built-in Format-Table and Sort-Object.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-UserProfile -SearchBase "OU=Computers,DC=comodo,DC=com" with built-in Format-Table and Sort-Object.
List User Profiles on Active Directory SearchBase computer.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -Force
List User Profiles on multiple remote computer and disable the built-in Format-Table, Sort-Object and disable the
Confirm Switch from Parameter Remove.
-------------------------- EXAMPLE 5 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -LocalPath "test1"
List User Profile with wildcard filter for LocalPath on multiple remote computer.
-------------------------- EXAMPLE 6 --------------------------
PS C:\\>Get-UserProfile -LocalPath "test1" -Remove
Remove User Profiles with wildcard filter for LocalPath from local computer.
-------------------------- EXAMPLE 7 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -SID "S-1-5-21-913119323-3770826481-2848448841-1001" -Remove -Force
Remove User Profile with specific filter for SID on multiple remote computer
Disable the built-in Format-Table, Sort-Object and SwitchParameter Confirm from Parameter Remove.
-------------------------- EXAMPLE 8 --------------------------
PS C:\\>Get-UserProfile -ComputerName pc1,pc2 -Days 30 -Remove -Force
Remove User Profiles with older than x days filter on multiple remote computer.
Disable the built-in Format-Table, Sort-Object and SwitchParameter Confirm from Parameter Remove.
RELATED LINKS