Azure AD – Working across tenants using PowerShell
Working across various tenants programmatically in Azure AD could be relatively complex. Before even writing a script to do such operations, one must be very clear about a few concepts about Azure AD. Azure AD application and service principal. An Azure AD application is defined by its one and only application object which resides in
How to move messages from dead-letter queue to its associated queue (Sequentially)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
private static void MoveMessages() { const string Queue_Name = "<Your_Queue_Name>"; const string ConnectionString ="<Your_Service_Bus_Endpoint>"; string deadLetterQueue = QueueClient.FormatDeadLetterPath(Queue_Name); QueueClient clientDeadLetter = QueueClient.CreateFromConnectionString(ConnectionString, deadLetterQueue); QueueClient client = QueueClient.CreateFromConnectionString(ConnectionString, Queue_Name); int counter = 1; while (true) { BrokeredMessage deadMsg = clientDeadLetter.Receive(); if (deadMsg == null) break; BrokeredMessage newMsg = deadMsg.Clone(); client.Send(newMsg); deadMsg.Complete(); Console.Write("\r {0}", counter); counter++; } } |