Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Trouble w/ Exchange tasks using native Powershell support in ARS

$
0
0

I'm trying to use a provisioning policy to add Exchange mailbox permissions to each mailbox as it's created.

 

With ARS Native Support of powershell, I should be able to easily run exchange commandlets from ARS, passing the $request.name value.  This SHOULD be easy, but I'm having a difficult time getting it to work.

No errors are generated in the event log on the activeRoles side, but on the MSExchange Management event Log has an "object not found" error.  I can do the exact same command from the standalone powershell command, and it succeeds.

 

I know how to this with VBScript, but it is VERY cumbersome, and VERY slow. So with that, PLEASE NO VBSCRIPT ANSWERS!

 

Please help me get this working w/ native Powershell support in ARS.

 

Here is my policy script. I simply want it to add the domain users group to have read permissions on our resource mailboxes.

 

#<start script>

function onPostCreate($Request){

Add-PSSnapin 'Microsoft.Exchange.Management.PowerShell.E2010' -ErrorAction:SilentlyContinue

Add-MailboxPermission $request.name -User "mydomain\domain users" -AccessRights ReadPermission
}

 

#<end script>

 

If I add the following line, i can see that the DN is properly passed through.

$EventLog.ReportEvent($Constants.EDS_EVENTLOG_WARNING_TYPE, "---- $request.name is " $request.name)

 

No errors are generated in the event log on the activeRoles side, but on the MSExchange Management event Log, I get the following error, and the permissions are not updated. Using the same account and syntax in the Exchange Management Shell succeeds without error.

 

Log Name: MSExchange Management
Source: MSExchange CmdletLogs
Date: 10/17/2011 3:27:23 PM
Event ID: 6
Task Category: (1)
Level: Error
Keywords: Classic
User: N/A
Computer: questserver.mydomain.com
Description:
The description for Event ID 6 from source MSExchange CmdletLogs cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Add-MailboxPermission
{Identity="CN=Lastname\, Firstname,OU=Test,OU=Sandbox,DC=int,DC=mydomain,DC=com", User=mydomain\domain users, AccessRights={ReadPermission}}
int.mydomain.com/Quest Service Account
Default Host-Local
1500
35
00:00:00.1259685
View Entire Forest: 'True',
Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException: "CN=Lastname\, Firstname,OU=Test,OU=Sandbox,DC=int,DC=mydomain,DC=com" wasn't found. Please make sure you've typed it correctly. ---> Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException: The operation couldn't be performed because object '"CN=Lastname\, Firstname,OU=Test,OU=Sandbox,DC=int,DC=mydomain,DC=com"' couldn't be found on DomainController.int.mydomain.com'.
at Microsoft.Exchange.Configuration.Tasks.DataAccessTask`1.GetDataObject[TObject](IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, Nullable`1 notFoundError, Nullable`1 multipleFoundError, ExchangeErrorCategory errorCategory)
at Microsoft.Exchange.Configuration.Tasks.DataAccessTask`1.GetDataObject[TObject](IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, Nullable`1 notFoundError, Nullable`1 multipleFoundError)
at Microsoft.Exchange.Management.RecipientTasks.PermissionTaskHelper.ResolveDataObject(IConfigDataProvider readOnlySession, IConfigDataProvider readOnlyConfigurationSession, IConfigDataProvider globalCatalogSession, IIdentityParameter identity, GetDataObjectDelegate getDataObjectHandler, TaskVerboseLoggingDelegate logHandler)
--- End of inner exception stack trace ---
at Microsoft.Exchange.Management.RecipientTasks.PermissionTaskHelper.ResolveDataObject(IConfigDataProvider readOnlySession, IConfigDataProvider readOnlyConfigurationSession, IConfigDataProvider globalCatalogSession, IIdentityParameter identity, GetDataObjectDelegate getDataObjectHandler, TaskVerboseLoggingDelegate logHandler)
at Microsoft.Exchange.Management.RecipientTasks.SetMailboxPermissionTaskBase.ResolveDataObject()
at Microsoft.Exchange.Configuration.Tasks.SetObjectWithIdentityTaskBase`3.PrepareDataObject()
at Microsoft.Exchange.Configuration.Tasks.SetRecipientObjectTask`3.PrepareDataObject()
at Microsoft.Exchange.Configuration.Tasks.SetTaskBase`1.InternalValidate()
at Microsoft.Exchange.Configuration.Tasks.SetObjectWithIdentityTaskBase`3.InternalValidate()
at Microsoft.Exchange.Configuration.Tasks.SetRecipientObjectTask`3.InternalValidate()
at Microsoft.Exchange.Management.RecipientTasks.SetMailboxPermissionTaskBase.InternalValidate()
at Microsoft.Exchange.Management.RecipientTasks.AddMailboxPermission.InternalValidate()
at Microsoft.Exchange.Configuration.Tasks.Task.ProcessRecord()
Context
Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException: The operation couldn't be performed because object 'CN=Lastname\, Firstname,OU=Test,OU=Sandbox,DC=int,DC=mydomain,DC=com"' couldn't be found on 'DomainController.int.mydomain.com'.
at Microsoft.Exchange.Configuration.Tasks.DataAccessTask`1.GetDataObject[TObject](IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, Nullable`1 notFoundError, Nullable`1 multipleFoundError, ExchangeErrorCategory errorCategory)
at Microsoft.Exchange.Configuration.Tasks.DataAccessTask`1.GetDataObject[TObject](IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, Nullable`1 notFoundError, Nullable`1 multipleFoundError)
at Microsoft.Exchange.Management.RecipientTasks.PermissionTaskHelper.ResolveDataObject(IConfigDataProvider readOnlySession, IConfigDataProvider readOnlyConfigurationSession, IConfigDataProvider globalCatalogSession, IIdentityParameter identity, GetDataObjectDelegate getDataObjectHandler, TaskVerboseLoggingDelegate logHandler)

the message resource is present but the message is not found in the string/message table


Viewing all articles
Browse latest Browse all 1277

Trending Articles