Public/Get-DeletedUsers.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function Get-DeletedUsers
{
    <#
    .SYNOPSIS
    Returns Deleted MSOL Users.
     
    .DESCRIPTION
    Returns all deleted MSOL Users to the console.
     
    .EXAMPLE
    Get-DeletedUsers
    #>

    [CmdletBinding()]
    Param()
    
    try 
    {
        Get-MsolUser -ReturnDeletedUsers | Write-Output
    }
    catch 
    {
        throw "Error running script"   
    }
}