Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

get 504 error when I use invoke-command

Hello community! I'm getting this error, while using invoke-command:the winrm client received an http status code of 504 from the remote ws-management serviceWinRM service is running on target. We're...

View Article


Disk activity on server 2012 SMB share by user

We actively monitor the actual disk activity buy i rarely investigate what user is behind the load. I was wondering if there would be an easy way to achieve this with PowerShell.Currently right now i...

View Article


Image may be NSFW.
Clik here to view.

Problem for send the result for a script

Hiii ,I execute my script I get the test results of two, but the third does not work, I do not get the final result. I get email with the name of the machine and the SID, as in the picture attached,...

View Article

Image may be NSFW.
Clik here to view.

Problem setting registry permissions using Powershell

I have a couple of scripts that I have put together to change the registry value of a specific key in the registry.  This primarily is being done on our Windows 7 machines as the XP setup is slightly...

View Article

Image may be NSFW.
Clik here to view.

a value not being returned

Can someone explain what is going on here.About half my machines are acting this way. I am probably doing something silly but it seems off.

View Article


Adding x500 addresses to multiple user objects using CSV input file

HelloI need to add an x500 entry containing the legacy DN from our previous mail provider to the proxy address attribute for all our AD users.I'm using a CSV file with the following format user,legacy...

View Article

powershell script to change all users proxy address attribute

We are adding an additional domain for email for all users. Using the script below works for one user but, is there a way to change all users at once. The name portion would have to reflect the users...

View Article

Get-WmiObject Win32_Service for a list of services

I would like to get the details on services, using a list of services.This returns all the services on a server: Get-WmiObject Win32_Service | Format-Table Name, DisplayName, State, StartMode,...

View Article


a PowerShell command that will recursively pull up all the groups that a user...

I found a good powershell command that will specifically list all  security groups a member is part of.For example  John is part of the groupA, GroupB, GroupC.   I  however was trying to add the...

View Article


Powershell do while loop that runs unitl I do a CTRL C

All, I am confused on how to exactly run a while true loop.  Essentially I would like to run this command repeatedly (every second) until I cancel it out. EX. - > get-WmiObject -class Win32_printer...

View Article

Filter out Get-WmiObject Win32_service for a list of services

For monitoring purposes I would like to filter out the results of the script below.I would like to be able to specify a list of exceptions (of services) which I don't want to have in my results. This...

View Article

Save the content of a text file on to webpage.

After use $notes = Get-Content D:\Notes.txt, I see that $notes still has multiple-line text in it.When save it after below, the webpage displays single-line text. I tried add <BR/> but not...

View Article

Configuring DHCP information using Powershell

Hi thereI'm a bit of a newbie at PowerShell, and I wanted to ask if you guys could help me with a query I want to run.Basically, I want to do the following:1)Query a whole bunch of remote servers,...

View Article


Script to clean HKEY_USERS

Hello, I currently have the foloowing issue.We are running citrix and when usrs sign in, their default printer resets to the local printers, (xps writer, send to one note, etc)This has been tracked...

View Article

Avoid newline without write-host

Hi, Developer,How to avoid newline without write-host in script as below?........ | ForEach {  $_.value+"," } | Out-File -FilePath done.csv -Encoding OEM Or........ | ForEach { "$_.," } | Out-File...

View Article


'System.Management.Automation.Remoting.PSRemotingTransportException' occurred...

I am using below code for opening a runspace on server machine.using (this.impersonator.CreateContext()) // using for impersonation            {                string remoteManagementPort =...

View Article

Foreach Output to CSV

Hi developer,I have a written a script but i have no idea how to the foreach output loop to csv file.Script is below:$regex = "([A-Za-z])\w+|\d+" $matchInfo = @((Get-Content \test.txt) |Select-String...

View Article


Powershell script running as Scheduled Task not able to get the Window of a...

Hi all,I need Powershell to check for the main window opened by an existing process with a given process ID. I used the following command to do so:-$title = (Get-Process -Id...

View Article

employeenumber behaving strange ? ? ?

I run : get-aduser -filter 'samaccountname -eq "xxx"' -properties employeenumber on different user'sIn the Attribute Editor I can see that they both have an employeenumber, nevertheless one user...

View Article

Diskpart Replacement

We have some disk as part of our provisioning process that needs to have the disk id changed for clustering.  We have a script that was a powershell/diskpart hybrid, but is pretty unreliable.  what i...

View Article
Browsing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>