Tuesday, February 28, 2017

[LY2013] Find the share of a pool




#Quickly find and open the share folder for the Lync pool

Invoke-Item(Get-CsService -FileStore | Select-Object -ExpandProperty UncPath)

[EX2013] Recreate arbitration mailboxes




Setup.exe /PrepareAD /IAcceptExchangeServerLicenseTerms

Get-User | Where {$_.Name –like "SystemMailbox*"} | Enable-Mailbox -Arbitration -Database IT_E15
Get-User | Where {$_.Name –like "FederatedEmail*"} | Enable-Mailbox -Arbitration -Database IT_E15
Get-User | Where {$_.Name –like "Migration*"} | Enable-Mailbox -Arbitration -Database IT_E15

Get-Mailbox –Identity "SystemMailbox{e0dc1c29*" –Arbitration | Set-Mailbox –Arbitration –DisplayName "Microsoft Exchange"

Get-Mailbox –Arbitration –Identity "FederatedEmail*" | Set-Mailbox –Arbitration –ProhibitSendQuota 1MB

Get-Mailbox –Arbitration –Identity "Migration*" | Set-Mailbox –Arbitration –ProhibitSendQuota 300MB

[WSRV] Capture machine FQDN




$fqdn = "$env:computername.$env:userdnsdomain"

import-module activedirectory
$name = hostname
$domain = (Get-ADDomain).dnsroot
$pc = ("$name"+"."+"$domain")
$pc

Tuesday, February 21, 2017

[EX2010] Remove special characters in public folder name




  • Look for special character in public folder name:

Get-MailPublicFolder | where {$_.alias.contains(' ') -or $_.alias.contains(',') -or $_.alias.contains('@') -or  $_.alias.contains('(') -or  $_.alias.contains(')') -or  $_.alias.contains(':') -or  $_.alias.contains(';')}



  • To fix the issue, run the cmdlet:

Get-MailPublicFolder | where {$_.alias.contains(' ') -or $_.alias.contains(',') -or $_.alias.contains('@') -or  $_.alias.contains('(') -or  $_.alias.contains(')') -or  $_.alias.contains(':') -or  $_.alias.contains(';')}| Foreach { Set-mailpublicfolder -Identity $_.Identity -Alias ($_.Alias -replace "\s|\,|\@|\(|\)|\:|\;") }



  • Run the first command again to check if still there are public folders with unwanted characters in the name

Sunday, December 18, 2016

[WSRV] Prevent Truncation of Long Output

Check with:


$FormatEnumerationLimit


Modify to unlimited:


$FormatEnumerationLimit =-1

Monday, October 17, 2016

[WSRV] Backup AD partition



ldifde -d "<configuration container>" -f configuration.ldf 

Sunday, August 7, 2016

[W10] Cannot sysprep Windows 10 installation




Check sysprep logs to review each modern application that needs to be removed

Remove them from Store program list

or 

  1. Run the Import-Module Appx PowerShell cmdlet.
  2. Run Import-Module Dism.
  3. Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation.

    Notes
    • In the output of this last cmdlet, check the users for whom the package is showing up as Installed. Delete these user accounts from the reference computer, or log on to the computer by using these user accounts. Then, run the cmdlet in step 4 to remove the Appx package.
    • This command lists all packages that were published by Microsoft and installed by any user of that reference computer. Because the computer is to be sysprepped, we assume that these user profiles no longer require the package.
    • If you have manually provisioned apps that belong to other publishers, run the following command to list them:

      Get-AppxPackage -AllUser | Format-List -Property PackageFullName,PackageUserInformation

  4. Run Remove-AppxPackage -Package <packagefullname>.
  5. Remove the provisioning by running the following cmdlet:

    Remove-AppxProvisionedPackage -Online -PackageName <packagefullname>

Sysprep fails after you remove or update Windows Store apps that include built-in Windows images
https://support.microsoft.com/en-us/kb/2769827