Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

2 Powershell scripts don't seem able to capture data on all machines

Posted on 2016-08-19
4
Medium Priority
?
110 Views
1 Endorsement
Last Modified: 2016-08-23
I have 2 different Powershell scripts downloaded from the internet. They work well but only on selected machines. On some machines, they fail to collect any data even though I have physically confirmed the data exists. What could need to be added or adjusted on these machines to allow the scripts to work?

Scripts are attached. I did not create these, they created by some very awesome Powershell programmers on Powershell.com and Reddit.
The long one goes through the steps and it visibly collects the data, I can see where it returns the usernames and the machine names. But then the output is always a noreply-date.csv. It seems like it collects the data but can't put it in the file for some reason.

The shorter one collects the data on  machines  by creating a ps session on that remote computer and putting the data in a file then copying that file back to my machine. It doesn't always collect the data, though. I have confirmed on a few machines that the data exists by going to them and looking but the text file is still blank.

Please let me know what might be causing these issues and any suggestions to get resolve them.

Thanks
GetMappedNetworkPrinters.txt
Getnetworkprinters.txt
1
Comment
Question by:Gjdalton
  • 2
4 Comments
 
LVL 17

Expert Comment

by:pjam
ID: 41762487
Possibly "Remote Desktop not Enabled?"
0
 
LVL 22

Accepted Solution

by:
Adam Leinss earned 2000 total points
ID: 41762524
Script 1:

Very cool script!  For anyone else that wants to play with it: you need to download the PSRemoteRegistry module (https://psremoteregistry.codeplex.com/releases/view/65928) and run Powershell elevated.  Works perfectly fine for me.  I would suggest using WMI Explorer (https://wmie.codeplex.com/) on the "problem" PCs and see if that works.  The Remote Registry service should be turned on for each PC.  

Script 2:

The 2nd script requires remote PowerShell (WinRM) to be enabled, which we don't have in our environment, so I will be unable to test that one.
1
 

Author Comment

by:Gjdalton
ID: 41765736
Thank you! Still reviewing answer to see if I can make it work with those settings.
0
 

Author Closing Comment

by:Gjdalton
ID: 41766825
This was very helpful. I tested several machines after installing the psremote-registry piece and they all worked well. I would still like to get the other to work correctly. I have ps-remoting enabled on the machines so I think it is something wrong in the code or some patch on the machines.

Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question