Solved

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

Posted on 2016-08-19
4
53 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 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now