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

get-process and UserName

Hi,I'm trying to list all/some process and need to include the username since the script has to run in a terminal server environment. It works using WMI (Get-WmiObjectWin32_Processand GetOwner()) but...

View Article


Execution Policy failing

Hi allOne of my SQL jobs which is related to Ps has just started to fail, I think its environment related as thesame code works on all other servers. Ironically, I  run the code below and then it fails...

View Article


Duplicate AD Object Without "Active Directory" PS Tools

Hello All,I need to know of a simple way to duplicate an Active Directory object (in this case a pkiCertificateTemplate), in a few lines of code as possible.  "Lain Robertson" posted a very elegant...

View Article

How to exclude hidden users$ from query results.

Hi AllI am trying to use the following code to total enabled users BUT no include the hidden accounts. I have tried using the SamAccountName, SamAccountType, Name and nothing seems to be working for...

View Article

Windows message box : powershell + WPF

I am working with message box and I want to display 1 to 50 in a column and 50 to 100 in an adjacent column in Message box.I am using  and $data contains an array from 1 to...

View Article


Find device id of NIC through powershell

Hi Guys,Any way i can find mac address  and device id of physical Nics through powershell Regards,TriyambakRegards, Triyambak

View Article

Permission denied only when PSRemoting

Hi,I want to run a command remotely but when I do it, it gives me a permission denied.Invoke-Command -Credential (Get-Credential) -ComputerName srvdfs02 -ScriptBlock { Get-DfsnFolder -Path...

View Article

Powershell script for AD help

Hi All, I am trying to disable over 2 million unused Window accounts in Active Directory.  I have a powershell command I am running but it keeps on timing out.  To make this simple, I want to use...

View Article


Outputting to Multiple Arrays to CSV

I have written a script that will look into a configuration file, grab PC name, Sockets, Available Socket and if there are any duplicates.The issue is if we clean up the duplicates...  we get a ton of...

View Article


Search-ADAccount -PasswordExpired isn't returning users whose password has...

I'm trying to use PowerShell to identify users whose passwords have expired, and I came across a very elegant one-liner via the Scripting Guy's blog:Import-Module ActiveDirectorySearch-ADAccount...

View Article

Trying to convert from Get-WmiObject to Get-CimInstance

I've been watching some of Don Jones' Powershell videos on Youtube and he said you should not use Get-WmiObject anymore since it has been deprecated. He said to use Get-CimInstance. I tried that but I...

View Article

I dont understand why I get the following: New-ADComputer : A required...

Hi,I'm a Domain Admin logged-on to a 2008 R2 RWDC.  Through the Active Directory Users and Computers interface I can add a new Computer object with no issue.  When I issue the following New-ADComputer...

View Article

Scripts with several parameters that require unc path, strings with spaces...

I wrote a script that is supposed to have several parameters needed in order to create and assign folder access.The script looks like this:script.ps1 -FullPath "\\unc\path with\spaces\" -Maingroup...

View Article


Run From Current Directory - Match Strings

hi friends, I would like to run this from the current directory. My script matches all the lines that have  TW5ZX8 and then out puts them to a file. Error cannot find path$Files = (dir *.txt)...

View Article

Call Batch File within Powershell

Hi, How can I call the batch file from C:\temp and run it on a remote computer?$comp - "win7machine"$ping = (test-Connection $comp -quiet)If ($ping) { $cert = get-certs $comp | ?$_.notBefore -gt...

View Article


Powershell GUI help

First off, I am not a powershell expert at all.  I have been trying to learn and decided to write a simple script our helpdesk people can use when a user leaves the company.  The script works great, I...

View Article

PowerShell ISE - NuGet-anyCPU Initialization Failed

I installed the module browser for the ISE but am unable to browse modules on the PowerShell gallery. When launching the ISE I receive a message indicating that the module browser requires...

View Article


EWS not returning user created folders

I have a folder in my Exchange Mailbox called 'XYZ'. It exists at the same level as the Inbox. I'm trying to use EWS to get to items in this folder, but I seem to be failing at finding the folder. Here...

View Article

help: debugging script

Hi,i'm new in powershell scripting and i met some pb with my script:I simplified the  script (https://gallery.technet.microsoft.com/office/PowerShell-to-InstallUninst-0536b17b)  to deploy office 2013...

View Article

Operator of comparaison on propertie phonenumber

Hello, I am new with powershell and i'm learning I have a little problem. I need to change the format of the phonenumbers of my AD users.  First, i would make a search to isolate the number I need to...

View Article
Browsing all 21975 articles
Browse latest View live


Latest Images

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