Search found 34 matches

by PS_Ross
Tue Apr 16, 2019 5:54 am
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 623

Re: Using Start-Job with credentials

I wound up taking a slightly different approach to this and using Powershell Studio's "Button - Start Job" control set. Below is my final code that is working (assume I have all the functions inserted correctly, to long to post them all). $Job1 = @{ Name = 'Job1' JobScript = { Param ($global:usercre...
by PS_Ross
Fri Apr 12, 2019 11:21 am
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 623

Re: Using Start-Job with credentials

Ok, that is what I tried initially, however it didn't seem to work. When I run the exact code you have above and debug the program, I get errors, in this order... ERROR: A parameter cannot be found that matches parameter name 'AllowClobber'. ERROR: Cannot validate argument on parameter 'Session'. Th...
by PS_Ross
Fri Apr 12, 2019 8:28 am
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 623

Re: Using Start-Job with credentials

Here is an example of what I have... $sb = { $splat = @{ ConfigurationName = 'Microsoft.Exchange' ConnectionUri = 'http://ServerName.doamin.com/PowerShell/' AllowClobber = $true } $s = New-PSSession @splat -Credential $global:usercred -Authentication Kerberos Import-PSSession $s (Get-MailboxDatabase...
by PS_Ross
Fri Apr 12, 2019 5:26 am
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 623

Re: Using Start-Job with credentials

Since you are already in a domain and using Kerberos you can very easily just do this. $sb = { $splat = @{ ConfigurationName = 'Microsoft.Exchange' ConnectionUri = 'http://ServerName.domain.com/PowerShell/' AllowClobber = $true } $s = New-PSSession @splat Import-PSSession $s # other code } Start-Jo...
by PS_Ross
Thu Apr 11, 2019 2:44 pm
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 623

Re: Using Start-Job with credentials

You would have to run all of your code as a job. Why use a job? The connection only takes 10 seconds even on a slow computer. Your scriptblock is also not written correctly which may cause many weird issues. $usercred = Get-Credential $s = New-PSSession -ConfigurationName Microsoft.Exchange -Connec...
by PS_Ross
Thu Apr 11, 2019 10:42 am
Forum: Windows PowerShell
Topic: Using Start-Job with credentials
Replies: 13
Views: 623

Using Start-Job with credentials

I am looking for some assistance using the Start-Job cmdlet. I am trying to run a background job to query some data from my Exchange environment. I need to build the connection to Exchange first, I currently use the following code to do so... $usercred = Get-Credential $s = New-PSSession -Configurat...
by PS_Ross
Mon Jul 16, 2018 6:11 am
Forum: PowerShell GUIs
Topic: 365 EWS Impersonation
Replies: 11
Views: 866

Re: 365 EWS Impersonation

Looks like that did it. Thanks bud.
by PS_Ross
Fri Jul 13, 2018 12:39 pm
Forum: PowerShell GUIs
Topic: 365 EWS Impersonation
Replies: 11
Views: 866

Re: 365 EWS Impersonation

If that is the output, then it is not working correctly. Sure the command is executing successfully, but that is not a correct recipient filter. I am not sure your experience with EWS Impersonation, but the output of the "RecipientFilter" command should not just be "DC=$groupdn", it should reflect t...
by PS_Ross
Fri Jul 13, 2018 10:57 am
Forum: PowerShell GUIs
Topic: 365 EWS Impersonation
Replies: 11
Views: 866

Re: 365 EWS Impersonation

I was using your suggestion from your previous post, think about how I am asking for help. So if you recommend something within reason, I am going to try it. Go back and look at your previous post where you literally typed the following line yourself; New-ManagementScope -Name $ScopeName -RecipientR...
by PS_Ross
Fri Jul 13, 2018 7:15 am
Forum: PowerShell GUIs
Topic: 365 EWS Impersonation
Replies: 11
Views: 866

Re: 365 EWS Impersonation

Yea, they definitely are tricky at times. So the top option you mentioned above won't work because we need the brackets, however I tried the 2nd option, which yields something slightly different. It looks like it tried to read it, but only took part of it. I have attached a screen shot of the output...