Labels

3300 (1) 3PAR (1) Active Directory (1) ADFS (1) Admin Share (1) Auto-Sync (2) Auto-Sync locked (1) AWS (3) AzCopy (1) Azure (3) Backups (2) Broadcom (1) Call Forwarding (1) CLI (2) cmd (1) Compatibility View (1) Dameware MRC (1) Databases (1) DFS (1) DNS (1) Domain Admin (1) domain controller (1) Enterprise Mode (1) ESXi 5.0 (1) ESXi 5.1 (5) ESXi 5.5 (3) Exchange (3) Exchange 2010 (5) Extreme (1) ExtremeXOS (1) Federation (1) File Share (1) FSMO (1) GPO (1) Group Policy (1) Group Policy Client (1) Hardware Acceleration (1) Helpdesk (1) HP-UX (1) Hyper-V (2) IAM (1) IE10 (1) IE11 (1) IP conflict (1) Kayako (3) LDAP (1) Licence (1) Links (9) local groups (1) LUN lock (1) LUN number (1) MAC address (1) Microsoft Teams (1) Mitel (1) Namespaces (1) Networking (6) Nexenta (6) NMC (1) Office 365 (4) OneDrive (1) Outlook 2003 (1) Outlook 2013 (1) PC (1) Physical (1) PowerCLI (10) Powershell (10) promoted links (2) Public Folders (1) RDP (1) RDS (1) Recovery Services (1) RedShift (1) Registry (3) Reports (1) Resolve (2) Restart (1) RSA (1) Run As (1) SAML (1) SAN (1) Scavenging (1) script (10) Server 2003 (3) Server 2008 R2 (1) Server 2012 R2 (2) Servers (2) sharepoint 2013 (3) SMTP (3) Snapshot (2) SRM (1) SSH (5) SSL Certificate (2) Temporary profile (1) Terminal Server (3) Troubleshooting (5) Ubuntu (1) Update Manager (1) Useful Apps (1) VAAI (1) vCenter Server Appliance (1) VDI (1) VDP (1) Veeam Backup and Replication (2) VM (1) VM Error (1) vmdk (1) VMFS (1) vMotion (2) VMware (20) VoiP (1) vSphere 5.5 (4) vSphere 6.0 (2) vSphere 6.5 (1) vUM (1) webpart (1) Windows (3) Windows 10 (1) Windows 7 (2)

Friday, 4 January 2019

Microsoft Azure: Get-AzSubscription Returns Token Error

Recently I changed my Azure login to use my organisational account rather than a Microsoft account for a particular subscription. Following this I found I was unable to access the subscription via PowerShell.

Running the cmdlet "Get-AzSubscription" (or "Get-AzureRmSubscription" if you use the older command set) returned the information for most of my subscriptions but threw the following warning for the subscription where my login had been changed;
WARNING: Unable to acquire token for tenant 'x''
After some investigation I found that my old credentials were cached in the context. Running the following cmdlet cleared this cache and allowed the subscription to be access via PowerShell again;
Clear-AzContext
(or Clear-AzureRmContext with the older cmdlets)

You can disable this auto-caching of tokens by using the following;
Disable-AzContextAutosave
(or Disable-AzureRmContextAutosave with the older cmdlets)

16 comments:

  1. Thank you very much - that seemed to be my issue!

    ReplyDelete
  2. Such a appears to be fully very best. Each one of these very little facts usually are constructed combined with many qualifications facts. I prefer of which a whole bunch. microsoft office 365 product key

    ReplyDelete
  3. Looked all over the place for a fix but this simple bit of code sorted all my probelms. Thank you so much

    ReplyDelete
  4. Thank you so much! This was driving me mad!

    ReplyDelete
  5. Your blog has chock-a-block of useful information. I liked your blog's content as well as its look. In my opinion, this is a perfect blog in all aspects. 2ms office 2016 product key

    ReplyDelete
  6. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. microsoft office 2016 free download full version

    ReplyDelete
  7. Once Coinbase successfully linked to your account, click the link of the Sell/Buy Bitcoin. The link will direct you to the Buy area so simply enter the amount of Bitcoin that you need, tick on your bank account, and choose "buy Bitcoin". bitcoin mixer

    ReplyDelete
  8. When bought as a component of an Office 365 membership, the Office 2013 projects and related administrations are consistently accessible in the most recent form just as moves up to future adaptations of Microsoft Office for a similar membership charge what begins at $10 to $15 every month for home or independent company renditions. help with excel spreadsheets

    ReplyDelete
  9. Software engineering is an essential discipline when designing and implementing high performance data enterprises. Although software engineers are not certified or sanctioned by any standards body, use of software engineers with experience in the Intelligence Community increases chances of success. windows 10 pro product key

    ReplyDelete
  10. The video game industry is moving fast and Microsoft are set to introduce their Kinect motion sensor in order to gain market share of the lucrative casual market. This article aims to examine Microsoft's marketing strategy and why what they might be planning for the Xbox brand windows 10 pro product key

    ReplyDelete
  11. Known mostly as a spreadsheet program - Microsoft Excel can actually be utilized for various purposes. This is exactly why the program is heavily used by businesses all over the country. Underneath the deceptively simplistic design, Microsoft Excel is a powerful program that helps your business to flourish. word translator

    ReplyDelete
  12. In order to fulfill your duty as a responsible citizen of the nation, one of the primary tasks you need to do is to pay for your income tax returns in a timely manner. Filing Income Tax Returns

    ReplyDelete