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

Get average of column from multiple csv files

Hello, I am seeking help on finding a way to calculate average of one column from multiple csv files and output to a separate csv file based on the name of source csv file.All of my csv files have the...

View Article


Collecting data from multiple SQL Servers

I'm sure there's a simple answer for this. I just don't know, how to do it. I need a way to collect data from multiple sql servers. I'm using the following code to fetch the data. (Not the real code)....

View Article


Ping multiple servers

Hello,I do have a requirement where I need to ping more than 20+ servers and if any servers failed the output need to be inserted into a SQL DB, From SQL DB the daemon will submit the output SMSC...

View Article

WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestC...

I am trying to run this function to the runt he following function to enable the agents in bamboofunction Enable-Agent([array]$agents){    $agents | %{        write-host "enabling agent name: $_"...

View Article

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


HOWTO combine multiple text files into one excel spreadsheet powershell

I' am a new in Power Shell world and i need to create a poweshell script which combine multiple text files into one excel spreadsheet With PowerShell  is it possible?  1 – Convert text files .txt TO...

View Article

Getting information from servers about all groups members and account status.

Hello PowerShell geeks, I am trying to pull out from hundred of servers information into Excel spreadsheet about all existing local groups including their members with account status. Because I'm new...

View Article

Filter on Mailboxes and disabled users in AD

Hi,  I am kinda new to powershell.  What I need. An Powershell command to retrieve all mailboxes sorted on accounts that is enabled in AD. We have an environment where people quits, moves and all sorts...

View Article


Copy-Item rename matches in a string variable question.

Hello.Obviously, the third line wouldn't work. Is it possible to make it work?Will appreciate any suggestions.Thank you.$replacePattern = '$matches[12].ToUpper() + $matches[04] + $matches[01].ToUpper()...

View Article


Limited powershell start-jobs

I curious if you can answer this or point me in the right direction.  ( I asked this on Stackoverflow and no one seems to be able to provide any input. ) I've written a script that tests/monitors urls....

View Article

New to Powershell- How to write a .ps1 script to add roles and features in...

Hello,Forgive me in advance if this is in the wrong section, but I am new to powershell and my boss has asked me to write a .ps1 script that will enable certain Roles and Features (IIS, FTP, Telnet...

View Article

UNZIP PowerShell Script

Hi group. I’m new to Powershell and need help. I’m would like to create a Powershell script that would unzip file extension *.zip. The file name contains PB or HB along with date and month [For...

View Article

Close an application gracefully?

I found this code:Get-Process Outlook |  Foreach-Object { $_.CloseMainWindow() | Out-Null }  I ran this and it closed Outlook.   My question is this:  is $_.CloseMainWindow() truly the graceful way to...

View Article


File and folder copy with comparison

Hi folks,Let me explain the situation. FolderA and FolderB had identical data (the same files and folders/subfolders structure) in them as they were in sync before. The sync between them has been...

View Article

error logging question

Hi all Using the following I intend to populate the telephone number field in AD: Import-Csv C:\test.csv | ForEach-Object {Set-ADUser -Identity $_.samAccountName -OfficePhone $_.telephoneNumber...

View Article


Server 2K8 script to check students config

Hi guys, We run a course where our students configure active directory with user accounts and permissions on server 2008. After they are done, then comes the laborious task of going through each...

View Article

Unzip Script

Please assist. I would like to create a Powershell script that would unzip file extension *.zip. The file name contains PB or HB along with date and month [For example: PBSTMT20141126.zip and...

View Article


Would you help me out with this function script ?

Create a function called MyName which has 2 parameters, FirstName and LastName.  Name the script Lab9_Functions_MyName.ps1.  Each name is to be input separately and if either parameter is empty, output...

View Article

query windows 2008 servers (15) for registry vaule

·         I want to query multiple  (15) Windows 2008 file servers  for a dword registry entry,·         I  don't want to change the value·         If the value is missing , the results of query could...

View Article

how to error check using asjob

I am using this to check if a server has dhcp enabled after setting it to static with another script.  My issue is i can't seem to figure out how to export the errors.  for example if i put a fake...

View Article
Browsing all 6937 articles
Browse latest View live