Redirect output of a script to a file
HelloI have a main script which calls other scripts and their functions. These functions contain Write-Host, Read-Host, Write-Error functions and some variables (as $ServiceList)How can I log all of...
View ArticleAdd columns to array
I am a beginner in PowerShell. I have a question about a script that I am working on. Param( [string]$SourceServer, [string]$SourceDatabase, [string]$InputFile, [string]$TargetServer,...
View ArticleHow do I run locally installed cmdlets on a remote server
Hi EveyoneI'm having difficulty executing cmdlets on remote machines.I've downloaded several modules, and functions on my local workstation. I've established a remote session with a server, and was...
View ArticlePowershell remoting for Lync failing
Hi, I am unable to remote to a server to import Lync modules. Here is the code (w/ server name removed): $credential = get-credential $session = New-PSSession -ConnectionUri 'https://<enter...
View ArticleConfiguration in PS script
I have to write a script for deleting files in folder based on this configuration .<item><where> c:\kapil\Test</where><days to keep>180</days to...
View ArticleSelecting Items From a List Box No Longer Works in Powershell Version 3.0
I've noticed that the script in this powershell tip of the week no longer seems to fully work in Powershell V3. The selection dialog will pop up as expected, with all of the elments populated, but the...
View ArticleIssue with array and named properties
I am trying to get the value of the ApprovalNumber for the selected item in the drop down to be passed to the second function. If I use the .ValueMember property all I get back is "= ApprovalNumber". I...
View ArticlePowershell 3.0 is broken on my Windows 8 machine
I'm running powershell 3 on Windows 8. It was working fine until yesterday. Now I can't use any cmdlet or other commands. Every single time I get a "X is not recognized as the name of a cmdlet,...
View Articlesend all posts to email?
Is there a setting that will automatically send all posts to this forum to an email address?
View ArticleEditing a local user
How can I change the check box where it says "Password does not expire" from unchecked to checked with out having to create a new user all over again.This is what I have so far.$Computer =...
View ArticleSOAP response enclosed in XD tags
Hello,I use this function to make a SOAP request to my server:function Execute-SOAPRequest ( [Xml] $SOAPRequest, [String] $URL ) { write-host "Sending SOAP Request To Server: $URL" $soapWebRequest =...
View ArticleInvoke-command icacls on a remote machine
OK this is a bit complicated to explain but i will try my best i am running a powershell script from my machine which has novell client installed which causes issues with setting windows file...
View ArticleHow to automate daily message tracking report for a user
Hi,Every day i am running the below command to export user1@abc.com daily send/receive tracking email report. But i need to automate this task. please help to automate it.Get-Exchangeserver | where...
View Articleinvoke-command -scriptblock with variables problem
Hi everyoneI'm a little frustrated, because I don't understand why this is not working.First this works.$Modules = "DnsServer","DnsClient" $s = New-PSSession -ComputerName $computerName -Credential...
View ArticleFunction wont accept parameter in script
I am having an issue with a function of mine acception a parameter. If I copy/paste the function into the shell and run it then set the variable and call the function it works! But if I run the script...
View ArticleErroring when entering PSSession
I don't know much about Powershell (FYI).The PC is running XP SP3 with latest PS available for XP.I'm trying to run the following cmd on a pc:$store = "store-6108-1" $storeuser = $store +...
View ArticleCommand to read data off csv file for powershell
Hi,I found this ps1 script off a web site where it will remove deleted AD users from user information list in SharePoint. Trouble is I want the command to read off a csv file under column called...
View ArticleAdd a column in this script to put an '*' if the PercentFree is below 10%
I want to add a column to the output called ATTENTION. In that column I want to display an "*" if percentfree is < 10%Any suggestions?$servers = get-content servers.txt foreach ($server in...
View ArticleHow could I convert index parameters into C#?
I need to convert Get-Mailbox | Select-Object -index (0..10) to C# code, but it give me the follow error,Parameter set cannot be resolved using the specified named parameters. at...
View Articlemanaging multiple "old" AD computer objects
So we have implemented a naming convention where the techs just select a location and department during the imaging process for a machine that is about to be deployed; during that process and the...
View Article