Search found 12564 matches

by jvierra
Tue Aug 21, 2018 8:50 am
Forum: Windows PowerShell
Topic: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?
Replies: 15
Views: 158

Re: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?

Here is an example to help you along: Import-Csv -Path $ExportCSVPath | ForEach-Object{ # Check if the file already exist or not if(Test-Path -Path "$ServerBackupUNCPath\$($_.PrimarySmtpAddress).PST"){ Write-Output "The user $($_.PrimarySmtpAddress).PST file is already existing" #Append the list of ...
by jvierra
Tue Aug 21, 2018 8:07 am
Forum: Windows PowerShell
Topic: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?
Replies: 15
Views: 158

Re: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?

You have to stop using this &{} and learn how to use the ForEach-Object construct to manage the pipeline.

I recommend going here to sort out you understanding of how this works: https://mva.microsoft.com/en-us/trainin ... shell-8276
by jvierra
Tue Aug 21, 2018 7:40 am
Forum: Windows PowerShell
Topic: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?
Replies: 15
Views: 158

Re: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?

Sorry. It should be like thi:

Code: Select all

Import-Csv -Path $ExportCSVPath |
      ForEach-Object{Get-MailBox $_.PrimarySmtpAddress} |
by jvierra
Mon Aug 20, 2018 11:53 pm
Forum: Windows PowerShell
Topic: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?
Replies: 15
Views: 158

Re: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?

Its a CSV. You have to reference it correctly. We've done this many times before.

Import-Csv -Path $ExportCSVPath |
Get-MailBox $_.PrimarySmtpAddress |
by jvierra
Mon Aug 20, 2018 4:52 pm
Forum: Windows PowerShell
Topic: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?
Replies: 15
Views: 158

Re: PowerShell to check file exist in the destination folder before exporting the Exchange email as .PST?

Same issue. What is this: "Get-Content -Path $InputCSVPath" You cannot .load a CSV suing Get-Content. A Csv has headers and columns. Get-Content will not convert it into anything. What is this supposed to do? &{ foreach ($User in $Users) { Write-Host "Processing.... $User" Get-Mailbox $User.ToString...
by jvierra
Mon Aug 20, 2018 2:52 pm
Forum: PowerShell GUIs
Topic: Jobs and DGV
Replies: 11
Views: 395

Re: Jobs and DGV

The last attachment was updated.
by jvierra
Mon Aug 20, 2018 2:31 pm
Forum: PowerShell Studio
Topic: TextBox "Lines" array not assigned when defined in proeprties browser.
Replies: 3
Views: 98

Re: TextBox "Lines" array not assigned when defined in proeprties browser.

I think I see the issue. When VS creates the textbox it assigns this way: this.textBox1.Text = "comp1\r\ncomp2\r\ncomp3\r\ncomp4"; The same in PSS but the conversion to a string fails because PS doesn't create the string the same way. The default separator in PowerShell is a space. Casting from a st...
by jvierra
Mon Aug 20, 2018 2:14 pm
Forum: PowerShell Studio
Topic: TextBox "Lines" array not assigned when defined in proeprties browser.
Replies: 3
Views: 98

Re: TextBox "Lines" array not assigned when defined in proeprties browser.

That is true but you can alter that in the designer by overriding the control to generate an array for the"Lines" property. Currently you are NOT assigning the "Lines" property bu are assigning the content of "Lines" to "Text" which causes the serialization failure. See: https://docs.microsoft.com/e...
by jvierra
Mon Aug 20, 2018 1:50 pm
Forum: PowerShell Studio
Topic: TextBox "Lines" array not assigned when defined in proeprties browser.
Replies: 3
Views: 98

TextBox "Lines" array not assigned when defined in proeprties browser.

To help you better we need some information from you. *** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. *** Product, version and build: latest 32 or 64 bi...
by jvierra
Mon Aug 20, 2018 1:42 pm
Forum: PowerShell GUIs
Topic: Jobs and DGV
Replies: 11
Views: 395

Re: Jobs and DGV

I found the mismatch and fixed it. Not sure why but loading from an array or file does not have the issue.