My last post wasn’t very well received, so I’ve learned from my mistakes and have a better, more thoughtout post this time.
I’m trying to gather various system info on our network computers with PSExec and get-computerinfo, however, when I run this script, it doesn’t print anything in the properties I’ve searched for, but when I search for all properties, it prints them.
No. You don’t. While your code is way shorter this time it is still unformatted.
What you’re trying to do is a very common task and has been asked a thousand times already and has been answered a thousand times already. Please use your prefered interent search engine and look for examples for tasks like this. There’s no need to re-invent the wheel again and again.
I was not aware that powershell remoting was capable of doing this task, and it is not a company standard where I work.
As far as searching for what I’m doing, either I don’t understand the things that I’ve found for doing this task, or I’m not finding the answers I’m looking for. So far this is the furthest I have gotten in this script, and I have tried a lot of different ways of achieving it.
Also I forgot about the formatting desired for this site.
You might improve your search skills. Mostly it is about using the proper key words. But you may keep in mind that for the vast majority of the cases or tasks you’re not the very first one. The chances are very high that you find something similar to your task you can tweak for your own needs.
You may do a big step back a start with learning the very fundamentals of PowerShell first. This will save you from a lot of wasted time and frustrations. And it wil lenable you to understand the help you get in forums like this.
You could still do it. Just go back, edit your question and fix the formatting.
Please do not post images of code as this is not helpful at all. Instead post the plain text formatted as code. You can format code even without the button in the edit bar when you put 3 consecutive backticks on an empty line then your code starting on the next line and then again 3 consecutive backticks on an empty line after your code.
Why don’t you at least give it a try with one computer? It will not hurt you.
If you’ve got the task of querying remote Windows computers PowerShell remoting is the way to go. You don’t have to decide it yourself but you should at least try to convince the according department to support a well supported industry wide state of the art technique for gathering information from remote computers in a Windows domain network. … just my 2 cts.
We trust you when you tell us that you don’t get any output. Images of code or console output just don’t make sence.
I already posted the proper command to get only this one property.
I cannot help you with psexec because I do not have any experience with it. And it is not PowerShell.
Formatting your code to make it easier to read is actually really simple. You can manually format using the back tick key repeated 3 time. Then next line put your code you want us to look at, then very last line is 3 more back ticks.
` <<< repeate that key a total of 3 times in a row to get started.
As far as searching for what I’m doing, either I don’t understand the things that
I’ve found for doing this task, or I’m not finding the answers I’m looking for.