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

Workflow Recursion workaround

Hi -Is there a workaround that will allow recursion within a PS workflow? I've got some code that looks up the IP address of trusted domains, then tries to connect to each IP address for each trusted...

View Article


Powershell not merging files

Hi there,I am literally hours new at Powershell scripting. I took on a project of developing a process that would scan a folder for presence of files matching a specific...

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

Write-Progress without something to count.

Hello all,I am writing some scripts for various Hyper-V tasks and would like to use "write-progress" for some of the tasks that take a long time in the scripts, for example "Export-VMSnapshot".I've...

View Article

PowerShell with Password

Here is the issue I have. I work for a large company and generally deal with many user who either work from home or are traveling. The issue we run into most of the time is that if the VPN is not...

View Article


Delete folders older than X days via SQL Agent Job

I've been trying to run the script below which is on my disk via a SQL Agent job with parameters but it just runs forever and never deletes any content.# Set limit -x days $limit =...

View Article

SQL Server Like syntax when used via Powershell

I'm writing some Powershell scripts to perform some basic SQL Server table maintenance.This is what I'm running in Powershell...Get-Query $SqlConnection "select top 1000 * FROM...

View Article

How does .NET refer to "by reference" in method calls?

Consider the following code that modifies some of the elements of array $a$a = 1,2,4,5,3,6 [array]::sort($a)What sort of lingo describes the arguments to a method where the method may modify the object...

View Article


Take last 4 digits in Business Phone and add to IP Phone atttribute

Hope someone can help. We have all our users 10 digit phone number in Active Directory under the Business Phone. We are integrating our Phone system with AD but want to pull the IP Phone attribute from...

View Article


is there a better way to get all servers in an AD forest using powershell

I am running this function to get all my servers from all domains in my forest.  Is there a better and faster way to do this function.---------------------function Get-Servers {...

View Article

ANUC.ps1 help

I am trying to modify http://gallery.technet.microsoft.com/scriptcenter/New-User-Creation-tool-14fa73cd ANUC.ps1 script so I can do firstnamelastname NOT firstname.lastname.  When I replace all...

View Article

divide string with ";" and search

hi Need helpSuppose i have a textbox where user is Pasting list of computer name and its separated by ";". So all the name in between the text in need to search.eg. SRV123;SRV-234;SRV-345powershell...

View Article

Powershell question about formatting a string of text

Examples are:One Two ThreeOne, Two, ThreeOne - Two - Three!I need to take a line of text like up in the example and convert it to a string of text where each word is separated with a dash and no...

View Article


Start-Process ignores the parameter "-wait" with explorer.exe

Hi all,maybe it´s a stupid question, but...Start-Process notepad.exe -Wait...will wait for closing the process "notepad.exe".Start-Process explorer.exe -Wait...will not wait for closing it, instead the...

View Article

Powershell with Batch file

I want to Verify the AD Credentials given in the batch file. I got the powershell script 2.ps1Function Test-ADCredentials {      Param([string]$username,[string]$pwd,[string]$domain)      Add-Type...

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

I need a powershell command to replace unicode chars in a file name to a...

Can anyone provide me with a powershell command which will search and replace a specific unicode character in a file name to just a blank space?Thanks

View Article


Script Add bulk user with CSV, and set expiration date

After importing the AD module, the line:Set-ADAccountExpiration -identity JohnDoe -timespan "365" Works just fine, but how would you automate this with a script that would read a csv-file. The...

View Article

Powershell Crashing, Faulting application name: powershell.exe, version:...

I am not sure where to post this but anyway here it goes...PowerShell Crashes when our users (Non Admin) try to run PowerShell scripts wehn logged into our W2k8 RemoteDesktop Servers. I have been...

View Article

Get-Counter ASP.NET Requests Queued

Hello  May I ask why my powershell script is not running? get-counter -counter '\ASP.NET\Requests Queued' -computername servername2 I'm running the script in server1.Windows Powershell ISE Host...

View Article
Browsing all 21975 articles
Browse latest View live