Office 365: ProvisioningFailedException: The name “XXX” is already being used. Please try another name.

Because I couldn’t find an answer to this issue anywhere else, and Microsoft Support was unable to determine the root cause I’m sharing this with you. During a cutover migration from Exchange 2003 to Office 365, my batchjob failed after the initial sync and was unable to process incremental syncs of emails in Exchange 2003.

The error in the batchjob’s status display for each failed user was:

ProvisioningFailedException: The name “XXX” is already being used. Please try another name.

Solution: delete the batchjob and all the users it provisioned. Recreate and run it again, and this time, don’t edit the primary SMTP address of these users while the job is running, it is used as a foreign key to match between Onprem and Office 365 and confuses the batchjob if it is changed.

The hint I got that gave me an idea of where this issue was coming from was the following error I received a few times (but not consistently) when changing the primary SMTP address of each user:

You can’t use the domain because it’s not an accepted domain for your organization.

The domain was fully validated and the email was not assigned to any other user.

So, don’t mess around while a batchjob is still running 🙂

Elevating powershell scripts, and staying in the script folder

Sometimes you want to be able to just double click your powershell scripts and see them work….putting this code at the top of your script will do just that by detecting if the script is running as administrator with administrative priviledges. If not, the script will launch a new instance of itself with an elevation prompt.

$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
 $arguments = "& '" + $myinvocation.mycommand.definition + "'"
 Start-Process powershell -Verb runAs -ArgumentList $arguments
 Break
 }
 cd $scriptPath

DFS Namespace failure

I ran into a hard to find but easy to fix issue today on a Windows 2008 R2 DFS server, the namespace suddenly lost all folder targets and displayed as an empty folder. The eventlog showed the following:

 

Event ID 14534, source DfsSvc: DFS Root xxxxx failed during initialization. The root will not be available.

Additionally, event ID 14503 was logged for each folder target under this namespace.

Solution: remove the server from the namespace, delete the namespace folder on the physical disk and readd the server to the namespace.

Content validation issues in SCCM 2012

Sometimes, distribution points have packages in their WMI repository that don’t exist any longer on the site server. When the distribution point goes through a content validation cycle, it will fail and change its status to ‘Warning’.

The error you’ll see in the Distribution Point Configuration Status overview is “Failed to validate content hash”.

Then something along the lines of “Failed to retrieve the package list on the distribution point. Or the package list in content library doesn’t match the one in WMI. Review smsdpmon.log for more information about this failure.”

So far it all sounds easy, and when we look at smsdpmon.log we do indeed see an error, 0x80070002 and the package ID in question. When we look up the package ID on the site server, it doesn’t exist.

To delete this package from the WMI repository Continue reading Content validation issues in SCCM 2012

Automatic IIS FTP server installation on Windows 7

For a certain application, a locally installed FTP server was required. Scripting this seemed easy, and plenty of examples could be found but none worked properly. So I’m sharing my method with you. Below code installs FTP. The final 3 lines enable anonymous authentication and create a Default FTP site that points to c:\temp

Hope it helps someone! Do note the reboot is actually mandatory.

dism.exe /Online /Enable-Feature /FeatureName:IIS-FTPExtensibility /FeatureName:IIS-FTPServer /FeatureName:IIS-FTPSvc /FeatureName:IIS-IIS6ManagementCompatibility /FeatureName:IIS-ManagementConsole /FeatureName:IIS-ManagementScriptingTools /FeatureName:IIS-ManagementService /FeatureName:IIS-Metabase /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerManagementTools /FeatureName:IIS-WebServerRole /FeatureName:IIS-WindowsAuthentication
<REBOOT HERE>
%windir%\system32\inetsrv\AppCmd set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.authentication.anonymousAuthentication.enabled:"True" /commit:apphost
%windir%\system32\inetsrv\AppCmd add site /name:"Default FTP Site" /bindings:ftp://localhost:21 /physicalpath:c:\temp\
%windir%\system32\inetsrv\AppCmd ADD vdir /app.name:"Default FTP Site/" /physicalpath:c:\temp

Microsoft 365, Azure, Automation & Code