devilish Posted November 1, 2011 Posted November 1, 2011 Hello! Maybe someone can help me on this topic. I'm an absolute powershell noob but since we are getting MS Exchange it's time to learn. All our unser management is based on linux. So I have to create ps scripts that one can start from linux using ssh. Scripts with new-aduser commands are running fine. Now I need to use "new-mailbox" so the script needs to load the Exchange PS Extensions and here is the problem. Using . RemoteExchange.ps1 Connect-ExchangeServer -auto .... New-Mailbox -UserPrincipalName $PrincipalName -Alias $Alias -Database $Database -Name $User –OrganizationalUnit $OU -Password $secure -FirstName $First -LastName $Last -DisplayName $Name -ResetPasswordOnNextLogon $False -PrimarySmtpAddress $email -Force $true -EmailAddressPolicyEnabled $false works fine localy. Via ssh . RemoteExchange.ps1 Connect-ExchangeServer -auto creates errors (missing registry keys etc). It looks like the RemoteExchange script trys to run using the copssh admin user and not the user connected by ssh. So is there an other way to get the exchange cmdlets running in my script? Any idears? Quote
devilish Posted November 4, 2011 Author Posted November 4, 2011 (edited) Hello! Ok, here is the solution. And the next problem... Solution: A powershell via CopSSH is 32 bit. The exchange cmdlets on my server are 64 bit. So they won't run. I've found a nice software. "Powershell SSH Server 5" from n/ software. It runs as a service and supports 64 bit powershell. Now I can - create users - create mailboxes But I need to create home-directories too: Our home-directories are stored on DFS. Only administrator can create new directories unter \\domain\home . First try: Do it direct on the domain controller. Open a powershell as user "Administrator". PS> whoami PS> domain\Administrator Run Script containing the new-item command for \\domain\home\username. => Directory created Second try: Do it over SSH Other system: Putty connection to domain controller as Administrator PS> whoami PS> domain\Administrator Run the same script as above => Error, access denied SSh Login user was the same user as the one opening the local powershell. Powershell service runs under the same credentials (tryed "Service" account too) So I am asking you: Has anyone a hint why the same user could not create the directory in an ssh session? Edited November 4, 2011 by devilish Quote
Infiltrator Posted November 5, 2011 Posted November 5, 2011 Too me it sounds like you don't have permission to create directories over a SSH connection. You will need to go over the permissions on your SSH server and make sure the account you are using has create directory permissions. "Error, access denied" generally means you don't have the proper permissions/access to do a certain task. Quote
Batmonkey Posted February 29, 2012 Posted February 29, 2012 This sounds more like remote execution is disabled I would recommend enabling remote execution though powershell the information how to can be found at the following link: http://technet.microsoft.com/en-us/library/dd347628.aspx Quote
digip Posted February 29, 2012 Posted February 29, 2012 From what I remember, you create all user data from Active Directory, and start the Exchange process in windows GUI, but have to complete the process in power shell. Exchange only creates the mailbox, so if the users don't exist already with their own file shares, etc, you need to create them first in Active Directory. Exchange will create the user in active directory, but they have no permissions or space quota from what I remember and no permissions. It basically fills in the name and info, but thats about it if you do it from exchange only. Someone correct me if I am wrong though. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.