mercredi 17 mars 2021

Need help to create a Do-While loop in PowerShell

I'm a fresh newbie to PowerShell and coding, but I need to make a do-while loop to achieve some tasks here.

I need to run this loop to detect if a specific user is being deleted from the Azure AD. If yes, restore the user.

I know how to list the deleted user by get-msoluser -returnDeteltedUsers

And I also know how to restore the user by Restore-MsolUser -UserPrincipalName "user's email"

But I need help with this if statement. How can I ask it to return true of false whether the user is deleted or not.

Thanks alot!

Aucun commentaire:

Enregistrer un commentaire