Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Browsing all 8583 articles
Browse latest View live

Invoke-command with "Run As Administrator" on remote machines.

Hi,I'm trying to run a command on a remote machine with the invoke-command cmdlet. The command fails with access denied in the eventlog. I need to run the remote session with "Run As Administrator" on...

View Article


.log file to richtextbox

Hello,i'm searching for the best way to show a microsoft .log file to a richtextbox. if u just do a get-content, i have somthing like that in richtextbox : <![LOG[Raised Program Started Event for...

View Article


Can a Param VALIDATESET include a command?

Hi Everyone,I was wondering, can i include a command instead of an array of strings? so that i can generate the the array automatically.I was thinking something like the example below to generate the...

View Article

Error while running the PS script at first time

Hello, When i execute below script in PS command line, first time this script will not execute and gives error.Then in same command line window if I run the same script second time it will execute.Can...

View Article

Getting the output of a batchfile to Powershell

Greetings. I have a list of batchfiles that triggers Powershell script, that will throw error message when different errors were encountered in the execution. In the end of the batchfile, I have...

View Article


Count word occurrences in an html file

I have a file that  contains a range of word e.g. alusfw001, gfr3044,hyr0067. the words are sites, what i want to do is use powershell to go into the file "site.html" which has these sites listed and i...

View Article

get avg value for times

hi there,   I am totally new to power shell 00:00.74. The below time date is in a text file....

View Article

Continuous loop

Hello again,I have created a task schedule to check DBA is always logged on. This is at 5 minute intervals. I am thinking a contiuous loop would work better and be less intensive.  for(;;){{ $i ; $i++...

View Article


Get-content of the previous day file

  I have two log files files as such with in a folder foo.log20140905           9/5/2014 11:04 PM        LOG20140905 File         649kbfoo.log20140906           9/6/2014 11:04 PM        LOG20140906...

View Article


Error handeling with Remove-QADMemberOf

Hello all,I have security on me to limit the users who have local admin access on desktop PC's.  I am at the point where I am trying to remove user account from nested Global Groups that are part of...

View Article

Shadowgroups and sending mail on specific days before password expires

I have no scripting skills, so please be patient with me :-)We have FGPP in place in combination with shadow groups.Used...

View Article

Using objects correctly to compare various Registry Keys on different Servers

I would like to compare two Servers registry keys to make sure they both match. Something simple like this was the initial plan:     $remote1 = (invoke-command -computername hostname `...

View Article

get-content -wait doesn't work for unknown reason

Hi,I'm using get-content with the parameter -wait as a logfile monitor on remote clients.It looks like this:get-content "$drive2\$progpath\log\message.log" -wait -readcount 0 -tail 10$drive2 is the UNC...

View Article


Move-Item giving access denied errors

I'm having an issue with my script and I need assistance in understanding the problem.I've created a script that creates/archives/reactivates users in AD. The issue comes when a user is archived. The...

View Article

Retrieving user's Volatile Environment data from remote computer

Hi,I'm currently working on a script which takes a computername and a domain username and uses it to retrieve registry information from a remote computer. The purpose of this script is to retrieve some...

View Article


Getting WMI Information

The first line works and returns softwareGet-WmiObject -Class Win32_Product | Select-Object -Property Name -unique I want to get all information about 1 software appGet-WmiObject -Class Win32_Product |...

View Article

split value of column and write along with key columns

I have a csv file one of them contains value separated by ;Here is sample dataRegion,OrderNo,OrderDate,ItemCount,ItemListAPC,APACBDDHKGUW142,7-Sep-14,3,IS13-073; IS14-009;...

View Article


foreach loop issue to display data from multiple servers

 $servers = @("server1","server2","server3","server4","server5","server6","server7","server8")    foreach($server in $servers)    {            $tgtFolder = "\\$server\LogFiles\foo_pilot\"...

View Article

More PowerShell Toolmaking Fun

I am having so much fun making my own PowerShell tools that I just can’t stop. I’ve been using my Get-Commandmetadata function...Read More 

View Article

Create a dynamic ConfigMgr Collection with PowerShell

The code in this post is to create the “All Windows 8.1 Clients” device collection in Chapter 5 of “Learn ConfigMgr 2012 in a Month of Lunches” The collection is a standard Device Collection with a...

View Article
Browsing all 8583 articles
Browse latest View live