You can find this out by using the following code (1 line):
System.Security.Principal.WindowsIdentity.GetCurrent.User.Translate(GetType(System.Security.Principal.NTAccount)).Value
You can find this out by using the following code (1 line):
System.Security.Principal.WindowsIdentity.GetCurrent.User.Translate(GetType(System.Security.Principal.NTAccount)).Value
If you find yourself getting this error message:
The application encountered an error while attempting to change the state of ‘VMName’. ‘VMName’ failed to change state. The operation failed with error code ‘32788.’
Go to the settings of your VM:
And look for something in an error state:
In this case I had changed Virtual Switch since using the VM so it’s no longer valid.
If you are trying to RDP into an Azure service and you get the message “This User Has Expired” that’s because when Cloud Services are deployed, the user is only enabled for a short period of time. If you don’t want to fully redeploy your application you can modify the expiration.
To do this, go to the service’s Configuration section and click the Download button to download the configuration file.
In that configuration file you’ll need to change the value for:
Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration
Go back to the configuration page and upload this file using the Upload button. Press Save and after a few moments it will change your user accounts expiration date.