Solved

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

Posted on 2016-08-19
4
87 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

751 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