Hi, Hoping for the some help. Im a newbie and trying to write my own scripts.
I’ve written a CSV which im importing into my powershell see below:
I need to pull all contact objects for 3 different domainnames and export to CSV but the below keeps pulling into the csv all contacts in the organisation
Any help would be appreciated, I know my main command is correct, the bit below as it returns what i need for an individual domain, but not for the multiple which ive specified on the importing CSV file.
@rob-simmers, thanks for the assistance, i’ve just tried that and I now just receive an empty contacts.csv with no data, where previous I had data in there, but just not the data I was trying to filter. Just can’t think what is wrong - Like i say the command it self works individually, but its the way im using the Import-csv
The quotes around the path in the pasted code looked incorrect (most likely because code tags were not used), so I’ll correct them, but this is basically the same concept for reference:
Yes, it was meant for you. The Import-Csv may have not been working because the qoutes were messed up from when the code was copied\pasted into the forums, I so I updated the previous post. Additionally, I was just providing a basic example using Get-Service to show you that the base code does work.
ok thanks. I have now read over you post a few times. So I see in your last post your suggesting to change the way I bring the multiple domain names. So using your method with the services I drafted the below. However I still receive a blank .CSV for my output…
This is actually the first time im trying to bring in multiple values for which I want my command to run against - So apologise for being such a Novice.
However using your method I have put together the below, but still get a blank CSV. Is the below correct? Using your method
@rob-simmers ive tried that. And see in the pic below. The $domainname variable configures correctly. However I recieved errors for the second line you gave me for the $Results variable. And the i try you 1st line for th $results variable, i have no output (eg: when i try to display the variable content by typing it, it simply goes back to the C:\ command prompt seens on the picture.