Script to list all of the Azure SQL databases in multiple Azure subscriptions

Welcome Forums General PowerShell Q&A Script to list all of the Azure SQL databases in multiple Azure subscriptions

  • This topic has 3 replies, 2 voices, and was last updated 3 weeks ago by
    Moderator
    .
Viewing 3 reply threads
  • Author
    Posts
    • #260346
      Participant
      Topics: 22
      Replies: 42
      Points: 317
      Rank: Contributor

      I have a working script that lists all of the Azure SQL databases in a single Azure subscription.  The user is prompted to enter the subscription name.  I’d like to be able to have the user enter multiple subscription names since we have multiple subscriptions.

      Any idea how I can place this in the script?

      Thanks,

      Frank

      • This topic was modified 3 weeks, 4 days ago by anelliaf38.
      • This topic was modified 3 weeks, 4 days ago by anelliaf38.
      • This topic was modified 3 weeks, 4 days ago by grokkit. Reason: embedded gist formatting - please read the guide
    • #260676
      Moderator
      Topics: 5
      Replies: 244
      Points: 1,368
      Helping Hand
      Rank: Community Hero

      I tried like this, and I hope it works for you…

       

      Thank you.

      • This reply was modified 3 weeks, 2 days ago by Kiran.
    • #260943
      Participant
      Topics: 22
      Replies: 42
      Points: 317
      Rank: Contributor

      Hi,

      That worked, but there are a few subscriptions where my account don’t have proper access and errors are returned.

      Is there a way to suppress the error message and let the script continue to run?

      Thanks,

      Frank

    • #261057
      Moderator
      Topics: 5
      Replies: 244
      Points: 1,368
      Helping Hand
      Rank: Community Hero

      Then, set ErrorAction preference to SilentlyContinue, or remove those Contexts on which you don’t have access.

      Thanks.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.