Powershell Script Help

Powershell Script Help

Hello,
 
I'm attempting to setup a Custom script that would change the mailbox type of a created mailbox to shared. I'm an amateur in Scripting and need some assistance.
 
This is my amateur script:
 
#Retrieve the value of the command line
param($admgr)
#Sets the mailbox Type  to shared. The account is automatically disabled as a result of this process.
Set-Mailbox $admgr -Type Shared
 
I added the script to the Bin folder in the AD Manager directory.
 
For the Custom Script box in the User Creation template I added this:
 
Powershell bsvsharedmailboxtype.ps1 -admgr %username%
 
The Account creates but I get this error message:
Custom Script Result :The term 'Set-Mailbox' is not recognized as the name of a cmdlet, function, scr ipt 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 C:\ManageEngine\ADManager Plus\bin\BSVSharedMailboxType.ps1:5 char:12 + Set-Mailbox <<<< $admgr -Type Shared + CategoryInfo : ObjectNotFound: (Set-Mailbox:String) [], Command NotFoundException + FullyQualifiedErrorId : CommandNotFoundException
 
Any help would be appreciated. Thanks

                New to ADSelfService Plus?