Quantcast
Channel: PowerShell General
Browsing all 10624 articles
Browse latest View live

Basic Else not working

This is a very basic script but I cannot get the Else to launch notepad. I have tried: & “C:\windows\notepad.exe"Invoke-Item “C:\Windows\notepad.exe"But it refuses to work when the condition is...

View Article


Set-Acl Access denied

Hy all I created a powershellscript, which delete folder permissions and set new ones on the userprofile folder, which is stored on a fileserver. The permissions of the user are not inherited, they are...

View Article


Parsing from one .csv into another

I'm trying to parse a live log file and pull only the current months info out of it, and create a new file from that parsed data. I can get the output I want to the screen with this. $strGetDate =...

View Article

An alternative to Posh v3 | out-grid -passthru in Posh v2

Hello AllI need to read in a csv file and display to result to the user, I was therefore thinking about using Out-Gridview.Now the user needs to review the information display and then click OK to act...

View Article

Powershell server specific modules / Windows 7

A general question: Will the server specific modules run as stand alone on my Windows 7 64-bit computer.  i.e. If I copy the 'Exchange', 'Sharepoint', etc modules to...

View Article


Using Active-Roles and Variables via Invoke-Command

Hi all, Firstly, apologies if this is in the wrong area. I've written a simple script to copy AD Groups from one machine to another using the Active Roles Snapin. This works fine on computers with the...

View Article

Renaming files

I need to rename a few thousand files that are in a few hundred sub-directories under the main folder.  Each of the files have different naming conventions, however they all have the year 2011 in...

View Article

Set-ACL problem passing a string instead of an object variable...

Hi, I have a problem that's giving me a head-ache but hopefully is simple to someone out there with a bigger brain than mine. Basically I have script for new user creation that picks up a variable...

View Article


How do I Make columns in PSobject closer?

I'm using the following code format below: $tobj =  New-Object PSObject$tobj | Add-Member -Name "Server" -Value $Server -MemberType NoteProperty$tobj | Add-Member -Name "Scenario" -Value...

View Article


Having Trouble Getting Hold of the Print Job when something is printed

As a series of baby steps to a more advanced printer script, I want to create a script that will pause a print job as soon as it is created.  I need to know what to put in the Action Block to get a...

View Article

Piping QADUser results to variable

I'm trying to run a query against AD that will pipe the results into a variable and then that variable can be called in another command.I have two text boxes (variables $UserFirstName and...

View Article

Microsoft Powershell Test Creator (Paid)

  Hey guys, I'm looking for a guru in Microsoft Powershell to create a multiple choice test on the subject. This is a PAID gig. The test will consist of 35 questions across various levels of...

View Article

Create multiple new AD users form a CSV and then add them to a list of groups...

Hi guys, I'm a little stumped. I'm trying to write a script which creates a list of users form a CSV file and then also adds them to a list of groups which is also store din the CSV file. so far I have...

View Article


Accessing Oracle Database 11g with Powershell

Hi there   Has anyone any experience with accessing a oracle 11g database in powershell?   Is there a module which can be downloaded in order to access a oracle database.   I want to extract data from...

View Article

Want to send info to Out-File using different credentials

Hi I want to do something like $info | Out-file $remotefile -Credential $cred but Out-file does not support this. Using an 'invoke-command' on localhost does not work well because it tried to run the...

View Article


RunAs administrator

I have tried to use the code below to open an application with runas Asminstrator on the UAC enabled environment. start-process -verb RunAs notepad But a 'Use Account Control' dialog appears to ask me...

View Article

Get valid write-host content to a variable

Hi The line  Write-Host (Get-Date) "LOGIN User:" $env:USERNAME works perfectly, but all attempts to get this info into a variable or pipe the info to another processor fail, e.g. $info = @((Get-Date)...

View Article


Test-Connection timestamp

I pieced together this powershell command: test-connection dwdmadwsa137 -count 2 -delay 60 | select __SERVER, Address, ProtocolAddress, ResponseTime | out-file c:\temp\test-connection.txt -append   It...

View Article

Script to lock webapplication

I need to lock/readonly the entire web application developed in sharepoint 2010.

View Article

Microsoft Server's last reboot time

Hello I am looking for a script that can tell me when all of the servers (2003\2008 etc)within a domain were last rebooted. I can compile a text file which lists all of the servers. Thank you  

View Article
Browsing all 10624 articles
Browse latest View live