This works well:
import-module activedirectory get-aduser -filter * | set-aduser -scriptpath filename_in_netlogon.vbs
This works well:
import-module activedirectory get-aduser -filter * | set-aduser -scriptpath filename_in_netlogon.vbs
Run the following within Active Directory Module for Windows PowerShell:
Get-ADobject -LDAPFilter "objectClass=organizationalUnit" -SearchBase "DC=domainname,DC=local" | Set-adobject -ProtectedFromAccidentalDeletion $true
Here’s a great set of steps for these:
http://blog.jocha.se/tech/azure-ad-sync-event-error-6126-and-6127
The short of it is:
Some articles:
https://msdn.microsoft.com/en-us/library/windows/desktop/ff384840(v=vs.85).aspx).aspx
https://blogs.technet.microsoft.com/filecab/2014/06/25/the-end-is-nigh-for-frs/
If one has one’s LAN Active Directory synchronized with EOL/Azure, one cannot add secondary email addresses in the EOL console. In this situation:
SMTP:user@domain.xyz
smtp:alias@domain.xyz
Also, as a bonus, after the above is done once, user objects in Active Directory Users and Computers get a new tab, “Attributes”, from which the above can be done for other users.
From the amazing Farhan Kazi:
http://fkazi.blogspot.com/2013/07/export-active-directory-groups-with.html
@ECHO OFF SETLOCAL EnableDelayedExpansion SET FileName=Report.csv SET AG=0 SET EG=0 SET CT=0 SET NE=0 SET GN= FOR /F %%T IN ('DSQuery * -Filter "(&(objectClass=Group))" -Limit 0') DO SET /a AG+=1 >NUL FOR /F %%T IN ('DSQuery * -Filter "(&(objectClass=Group)(^!member=*))" -Limit 0') DO SET /a EG+=1 >NUL SET /a NE=!AG!-!EG! ECHO Total Groups in Active Directory %AG% out of them %EG% are empty.&&ECHO. ECHO Group,Members>"!FileName!" TITLE Exporting !NE! Non-Empty AD Groups. FOR /F "delims=" %%G IN ('DSQuery * -Filter "(&(objectClass=Group)(member=*))" -Limit 0') DO ( FOR /F "delims=" %%v IN ('DSQuery * %%G -l -q -Attr Name -Limit 0') DO SET GN=%%v SET /a CT+=1 >NUL ECHO !CT!. Exporting: !GN! FOR /F "delims=" %%M IN ('DSGET Group %%G -Members') DO ( FOR /F "delims=" %%U IN ('DSQuery * %%M -l -q -Attr displayName') DO ( ECHO !GN!,%%U>>"!FileName!"))) TITLE Export complete. ECHO.&&ECHO Export complete, please check '!FileName!' file. EXIT /B 0
Here’s a mod, which creates one file per group:
REM REM Export all Active Directory groups to CSV files REM One CSV file per group REM REM Original written by Farhan Kazi REM http://fkazi.blogspot.com/2013/07/export-active-directory-groups-with.html REM REM Modded for one file per group by Jonathan Brickman REM http://n.ponderworthy.com REM @ECHO OFF SETLOCAL EnableDelayedExpansion SET AG=0 SET EG=0 SET CT=0 SET NE=0 SET GN= FOR /F %%T IN ('DSQuery * -Filter "(&(objectClass=Group))" -Limit 0') DO SET /a AG+=1 >NUL FOR /F %%T IN ('DSQuery * -Filter "(&(objectClass=Group)(^!member=*))" -Limit 0') DO SET /a EG+=1 >NUL SET /a NE=!AG!-!EG! ECHO Total Groups in Active Directory %AG% out of them %EG% are empty.&&ECHO. TITLE Exporting !NE! Non-Empty AD Groups. FOR /F "delims=" %%G IN ('DSQuery * -Filter "(&(objectClass=Group)(member=*))" -Limit 0') DO ( FOR /F "delims=" %%v IN ('DSQuery * %%G -l -q -Attr Name -Limit 0') DO SET GN=%%v SET /a CT+=1 >NUL ECHO !CT!. Exporting: !GN! FOR /F "delims=" %%M IN ('DSGET Group %%G -Members') DO ( FOR /F "delims=" %%U IN ('DSQuery * %%M -l -q -Attr displayName') DO ( ECHO %%U>>"!GN!".CSV))) TITLE Export complete. ECHO.&&ECHO Export complete. EXIT /B 0
Try:
NET USER <USERNAME> /DOMAIN /ACTIVE:YES
It’s called adding a UPN suffix, and it’s documented here:
The following command often works:
dcdiag /fix
There is also:
netdiag /fix
To remove an old exchange server from AD:
Start/Run, adisedit.msc
Then expand:
CN=Configuration>CN=Services>CN=Microsoft Exchange>CN=Organization name>
CN=Administrative Groups>CN=Servers
Then delete the old server by name.