> For the complete documentation index, see [llms.txt](https://oscp.adot8.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oscp.adot8.com/windows-privilege-escalation/user-switching.md).

# User Switching

```
$password = ConvertTo-SecureString "pwd123" -AsPlainText -Force
```

```
$cred = New-Object System.Management.Automation.PSCredential("daveadmin", $password)
```

```
Enter-PSSession -ComputerName CLIENTWK220 -Credential $cred
```

```
PS C:\Users\dave> $password = ConvertTo-SecureString "pwd123" -AsPlainText -Force
PS C:\Users\dave> $cred = New-Object System.Management.Automation.PSCredential("daveadmin", $password)
PS C:\Users\dave>  Enter-PSSession -ComputerName CLIENTWK220 -Credential $cred
[CLIENTWK220]: PS C:\Users\daveadmin\Documents> whoami
clientwk220\daveadmin

```
