Archive for September, 2015

Basically if you have correctly configured your web-server, with correct limits (from #ipcs -l command). There will be a moment if this is not scripted, that the limit will be broken. Then, there’s an easy way to clear the limits.

for ipcs in `ipcs -s | awk '{print $2}'`; 
do
echo "ipcs=$ipcs"
ipcrm -s $ipcs
done

You have more than 500-1000 users and need to change the UserPrincipalName?
Easy.

$ou="OU=marketing,DC=domain,DC=com"
$old='marketing.domain.com'
$new='accounting.domain.com'

Get-ADUser -Filter * -SearchBase $ou | ForEach-Object { $newUpn = $_.UserPrincipalName.Replace($old,$new) $_ | Set-ADUser -server $server -UserPrincipalName $newUpn }

ATTENTION!
Of course it is better to debug the command before running in production environment so place a “-WhatIf” mark after the command, like this:

Get-ADUser -Filter * -SearchBase $ou | ForEach-Object { $newUpn = $_.UserPrincipalName.Replace($old,$new) $_ | Set-ADUser -server $server -UserPrincipalName $newUpn -WhatIf }