Script to run against ALL AD users in a loop RRS feed

  • Question

  • I am going to do a SharePoint upgrade this weekend from 2010 to 2013.

    I need this script to run against every Active Directory user automatically, not just one at a time. How do I get this get this script to do that? I figure I create a pipeline, I just don't know where.

    Here is the script:

        [string]  $account = $(Read-Host -prompt "UserAccount")
    Add-PSSnapIn Microsoft.SharePoint.PowerShell
    foreach ($wa in get-SPWebApplication)
        Write-Host "$($wa.Name) | $($wa.UseClaimsAuthentication )"
        $wa.UseClaimsAuthentication = $true
        $account = (New-SPClaimsPrincipal -identity $account -identitytype 1).ToEncodedString()
        $zp = $wa.ZonePolicies("Default")
        $p = $zp.Add($account,"PSPolicy")

    Please help me! Thank you!

    Monday, November 3, 2014 6:10 PM

All replies