Quantcast
Channel: Windows PowerShell Forum
Browsing all 2562 articles
Browse latest View live

Get-ADGroup -Properties

I am trying to output only the Name property of a list of AD groups. I am using the following - Get-ADGroup -Filter{name -like "ORG-*"} -Properties Name -SearchBase "ou=Test ,dc=test,dc=test" The...

View Article


Find string literal in a collection of text files

I have a file name with a list of table names - "audit_tables.txt". I need to search a collection of log files for those table names.  In the log files, the table names with reside between two...

View Article


web page: I would like Powershell to serve up a web page

hi there, I'm looking to see if there is a way to have Powershell listen on a particular TCP port (for example, port 80) and serve up a web page? I don't want to use IIS...I would like to have a script...

View Article

Modifying printer queue device settings

I have very limited power-shell experience, please help point me in the right direction. I have ~50 HP (p2055dn) printers with a 500 sheet supplemental tray. (Tray 3) *25 terminal servers print to this...

View Article

Remove-Variable does not work on PS command line

I have done script like this (see below). It works fine on ISE environment but I got error message on PS command line environment. Error message is "Remove-Variable: Cannot find a variable with name...

View Article


Create New User Account

Hey guys, Currently I want remotely create user account to many computers, so I tested on my own computer first. But when I run the code, the user account only appear in parental controls. I can only...

View Article

Runas with Powershell

Hello, Here is a part of PS script which is working now: $Params = "-Sign", "`"$DFSPathClient\ClickOnce\$Config_Filename_Sign`"", "-Certfile", "`"$Cert`"" Write-Host "Signing Parameters: " $Params...

View Article

Create DFS links with powershell?

Hello. First of all, I just want to say that I'm very new to powershell and this is all learning-by-doing from my part. As part of a new fileserver solution, we will place the homefolders in a DFS...

View Article


how to use scheduled job to run powershell

Hi.  I was trying to use a scheduled job to have powershell come up automatically when I log in.  I did the following:  created a scheduledjobs option object with the -runelevated parameter, created a...

View Article


Using WMI date conversion for Win32_NTLogEvent reporting but can't get query...

Hello I'm trying to use this feature for reporting across LAN on a Server 2003 estate. I understand the date conversion, but can't get my results to filter for today only.  It seems that Get-Date does...

View Article

Connect to different domain controller

What will be powershell script to connect  to different domain controller from powershell module to AD?

View Article

How do I run a ps1 elevated as a scheduled job

how do I get powershell script to run as administrator in a scheduled job?

View Article

Delete hidden files starting with ~$?

I am trying to run a script on user folders to cleanup .tmp files and office temp files that start with ~$ that are hidden.  Here is my script: $SourceDir = "\\Server\Students\" foreach ($file in...

View Article


manipulating result of WMI call (win32_networkadapterconfiguration)

My desired result is to display the DNS servers listed in the IP config of a computer in a CSV format. I am getting the DNS servers ok, with the simple WMI call, but I'm having trouble isolating the...

View Article

Getting my PS script to pull forwarded events.

Below is the script I have to pull all event and write them out to a directory. It works perfectly for the standard events but not forwarded. And honestly, that is all I want. Can anyone assist in...

View Article


how can we take input from powreshell GUI application and execute the code

I am trying to make powershell GUI application. where I can take input as parameter from GUI and execute it and provide output in table form in GUI. Below is the code. when code is executed it shows...

View Article

Execute user input in ScriptBlock

So I am trying to get [1] this code to work. What I would like is to have is a script that, when run, asks for a command. I would enter the command I want run on the computers I specify, and the script...

View Article


to move files and rename if needed

Hi, I would like to automate moving files from one machine to another using powershell that seems to be easy to accomplish by Move-Item, but I need to use Rename-Item as well in case a file with the...

View Article

Get filename that does not contain the specified string

I'm looking thru a group of files in a particular directory for a specified string, but I need to get the file names that do NOT contain the string.  This will get me a TRUE / FALSE, but without the...

View Article

Archive files older than two Fridays ago

Okay I have the hard part done, I've got it calculating the right age of files, but when I loop through my folders it's losing it...and I'm not seeing why? Basically I'm searching a directory that...

View Article
Browsing all 2562 articles
Browse latest View live


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