While trying to create a new sp site using power shell cmdlet New-Site, I received the following error.
The term 'OwnerAlias' is not recognized as the name of a cmdlet, function, scri
pt file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:11
+ OwnerAlias <<<< DOMAIN\USERID-
+ CategoryInfo : ObjectNotFound: (OwnerAlias:String) [], CommandN
otFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The simple solution was to remove extra space in my script following ‘-‘. Here is the sample script that I used which worked.
New-SPSite http://url$ -OwnerAlias DOMAIN\USERID - HostHeaderWebApplication http://SERVERNAME