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
Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

790 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