Author: DaisyStevens100

PS: Skype For Business Voice User Set CLI

PS: Skype For Business Voice User Set CLI

The following snippet will commit for the following steps within you Skype for business online environment

  • Open Powershell S4B Session
  • Create a new CLI Policy to withhold CLI
  • Assign new CLI policy to test user
# Connect to Skype For Business Online / Lync Online
Import-Module LyncOnlineConnector
$sfbSession = New-CsOnlineSession
Import-PSSession $sfbSession
# Add CLI Policy
New-CsCallingLineIdentity -Identity Anonymous -Description "anonymous policy" -CallingIDSubstitute Anonymous -EnableUserOverride $false
# Assign CLI Policy
Grant-CsCallingLineIdentity -Identity "Example@Example.com" -PolicyName Anonymous

 

Advertisements
PS: User Mailbox SMTP Alias Address Report

PS: User Mailbox SMTP Alias Address Report

Hi Everyone,

Here is a quick and dirty script that will produce a table within your terminal session showing you each user mailbox along with any additional SMTP addresses that are associated to each of the mailbox’s

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
# Collect Data from exchange and store into varible
$box = Get-Mailbox | Where {$_.name -NotLike ‘*DiscoverySearchMailbox*’} | Where-Object -Property RecipientType -eq -Value UserMailbox | select primarysmtpaddress,name,@{Name=”EmailAddresses”;Expression={ ($_.EmailAddresses | Where-Object {$_ -cmatch “s mtp:*”} | ForEach-Object {$_ -replace 'smtp:' }) -join ',' }}
# Perform Count of records in varible
$count = $box | measure
# Count Output
Write-Host "Result Count: " -NoNewline -ForegroundColor Green $count.Count
# Result Table Output
$box | ft -autosize

 


Old Code

$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session Get-Mailbox | Where {$_.name -NotLike ‘*DiscoverySearchMailbox*’} | Where-Object -Property RecipientType -eq -Value UserMailbox | select primarysmtpaddress,name,@{Name=”EmailAddresses”;Expression={ ($_.EmailAddresses | Where-Object {$_ -cmatch “s mtp:*”} | ForEach-Object {$_ -replace ‘smtp:’ }) -join ‘,’ }} | ft -AutoSize

PowerCLI: Search VM By MAC Address

PowerCLI: Search VM By MAC Address

The below snippet is pretty useful for when you have a mac address conflict between your VM’s. The VMware alarm/flag does not tell you the VM that it MAC conflicts with so time to open up PowerCLI and run the below example

 

Get-VM | Get-NetworkAdapter | Where {$_.MacAddress -eq “00:59:59:c9:da:9a”} | select @{Name="VM";Expression={$_.Parent}},MacAddress | ft -AutoSize