Clear-Host
Function Console {
$Host.UI.RawUI.WindowTitle = "Developed by Ravindra Sharma"
#$Host.UI.RawUI.BackgroundColor = "Black"
#$Host.UI.RawUI.ForegroundColor = "White"
$winsize = $Host.UI.RawUI.WindowSize
$winsize.Width = 120
$winsize.Height = 40
$Host.UI.RawUI.WindowSize = $winsize
$buffer = $host.ui.RawUI.BufferSize
$buffer.width = 120
$buffer.height = 3000
$host.UI.RawUI.Set_BufferSize($buffer)
}
<#
$position = $host.ui.RawUI.WindowPosition
$position.X = 0
$position.Y = 0
$host.UI.RawUI.Windowposition = $position
#>
#Clear-Host
function Header {
for($i=1; $i -le 120; $i++){Write-Host -NoNewline "#" -BackgroundColor Gray -ForegroundColor Gray}
Write-Host ""
Write-Host ""
for($i=1; $i -le 40; $i++){Write-Host -NoNewline " "}
Write-Host -NoNewline " || WINDOWS SERVER - T O O L S || " -ForegroundColor Yellow
#for($i=1; $i -le 30; $i++){Write-Host -NoNewline "-" -ForegroundColor Black -BackgroundColor Black}
Write-Host ""
Write-Host ""
for($i=1; $i -le 120; $i++){Write-Host -NoNewline "#" -BackgroundColor Gray -ForegroundColor Gray}
Write-Host ""
for($i=1; $i -le 40; $i++){Write-Host -NoNewline " "}
Write-Host -NoNewline " powershell.ravindrasharma.com" -ForegroundColor Green
Write-Host ""
Write-Host ""
}
function Menu {
for($i=1; $i -le 120; $i++){Write-Host -NoNewline "-" -ForegroundColor Yellow}
Write-Host ""
Write-Host " 1. Check the drive letter" -ForegroundColor Cyan
Write-Host " 2. Get hard disk information" -ForegroundColor Cyan
Write-Host " 3. Get MAC Address" -ForegroundColor Cyan
Write-Host " 4. Total Block Email IDs Count" -ForegroundColor Cyan
Write-Host " 5. Total Deleted Email IDs Count" -ForegroundColor Cyan
Write-Host ""
Write-Host " 6. Search User and Check its Status" -ForegroundColor Cyan
Write-Host " 7. Reset The User Password" -ForegroundColor Cyan
Write-Host ""
Write-Host " 8. Clear the Screen" -ForegroundColor Cyan
Write-Host " 9. CSV Report Options" -ForegroundColor Cyan
Write-Host " 10. Exit" -ForegroundColor Cyan
Write-Host ""
for($i=1; $i -le 120; $i++){Write-Host -NoNewline "-" -ForegroundColor Yellow}
}
Console
Header
Menu
Do
{
# Write-Host -NoNewline "Type and Enter the Above Number:" -ForegroundColor Yellow
$a = Read-Host "Type and Enter the Above Number: "
switch ($a)
{
1 { Write-Host ""
Write-Host "## Check Drive Letter ##" -ForegroundColor Yellow
(Get-Volume)}
2 {Write-Host "Disk Information " -ForegroundColor Green (Get-Disk)}
3 {Write-Host "Total Active Email IDs Count " -ForegroundColor Green (Get-MsolUser -All -EnabledFilter EnabledOnly).Count}
4 {Write-Host "Total Block Email IDs Count " -ForegroundColor Red (Get-MsolUser -All -EnabledFilter DisabledOnly).Count}
5 {Write-Host "Total Deleted Email IDs Count " -ForegroundColor Red (Get-MsolUser -All -ReturnDeletedUsers).Count}
6 {#$SearchUser=Read-Host "Search User "
# Write-Host "Searching Word is :"$SearchUser;
# Get-MsolUser -SearchString $SearchUser | ft DisplayName,FirstName,LastName,UserPrincipalName,Department,City | Out-GridView
Get-MsolUser -All | Out-GridView -Title "Total User (Licensed-True + Unlicensed-False)" -PassThru | Format-Table
}
7 {
Get-MsolUser -All | Out-GridView -Title "Reset Password" -PassThru | ForEach-Object { Set-MsolUserPassword -UserPrincipalName $_.UserPrincipalName -NewPassword Focus@123 -ForceChangePassword $False}
Write-Host "Email ID Password has been reset to Focus@123" -ForegroundColor Green
}
8 {Clear-Host; Header; menu}
9 {Write-Host "Advanced Option"; Invoke-Item c:\ps\office365\c_menu2.exe}
default {"";Write-Host "! ! ! Exit ! ! !" -ForegroundColor Red ;Start-Sleep -Seconds 1;Exit}
}
start-sleep -s 1
}
while ($a -le 9)