Substring(0,25) Fails when the string is less than 25 characters
@{Name="proxyAddress";Expression={$_.proxyAddresses.substring(0,38) -join "`n"}}This is part of a PS script that searches the AD for a user and returns certain values.Problem was the ProxyAddress field...
View Article$ie.ExecWB(6, 2) on different website
I save webpages on different websites to xps files by using $ie.ExecWb(6, 2) function in PS. The script ok for long time. Since last weekend, the function stopped working on one website. When running...
View ArticleDynamically get Hyper-V Servers, get all the VM dns names
Has anyone Idea?I'm working for hours on this but I'm not getting anywhere.foreach($system in $systems){ $hyperv = invoke-command $system.DNSHostName -ScriptBlock {get-windowsfeature | Where {$_.name...
View Articleadd-pssnapin Microsoft.Exchange.Management.PowerShell.Admin
I have a script (below) that was designed to be used by people who do not have access to Exchange. The idea is to check if ActiveSync is enabled for the user, it gives the ability to enable or disable...
View ArticleReset the DNS Zone to the Active Directory integrated Zone
Dear All, Need one help, Could any one help me provide a PS script to reset all the DNS Zones on a server to the Active Directory Integrated Zones ?Thanking you,Regards, Ketan
View ArticlePowerShell Exchange Command
Try to build a GUI for some mailbox administration stuff..... The command below produces syntax errors.Get-Mailbox $dlist.alias -Resultsize Unlimited | Search-Mailbox -SearchQuery...
View Articlenew-webserviceproxy and ssl
Hello everyoneI have been searching and have not found a method to use new-webserviceproxy that the url requries an ssl cert for auth.I have the cert installed in my local store and i can navigate...
View ArticleSet-VMHardDisk
I am trying to use this cmdlet on a virtual machine in a cluster. Unfortunately, I receive the following error:Set-VMHardDiskDrive : A parameter is invalid. Hyper-V was unable to find a virtual machine...
View ArticleHyper-V Powershell cmdlets 2008 R2
I just want Hyper-V cmdlets to work on 2008 R2..googled, and googled, and have been all over the place, reading different stuff, attempting different solutions..Have read that its not possible, have...
View ArticleHow to calculate the difference between values in a custom PSObject?
If I have a PSObject (created from an imported CSV) that has data like the following:date,Total size of files uploaded03-17-2014 09:08,129333457454703-17-2014 09:10,129333532691203-17-2014...
View ArticleTerminating the execution of a script
I apologize for the very basic question, but I was unable tyo locate the answer in the web.How can I tell a scipt to stop execution (do not do anything else)?I want to issue a command to terminate the...
View ArticleExport AD username based on e-mail address
Hello, I'm very new to powershell. I'm looking for a script that can export sAMAccountName based on what the users e-mail address is. I have a *.csv file with 180 e-mailaddresses and I want powershell...
View ArticleAccessing elements of hashtable, what am I doing wrong?
Hello,I have hashtable of a hashtable $a. I want to format this information where both FreeSpaceNow and OriginalFreeSpace are appearing as their values in the table and having hard time understanding...
View Articleunpersistent drive mapping question
We have a large (200+) set of shares to map to various users based on group membership via PowerShell login script. I am very familiar with the arguments for using GPP with item level targeting as a...
View ArticleAppending to file, getting error file is being used by another process;
I am using a function posted on stackoverflow to check if a file is locked and append contents from another process....
View ArticleCert error when trying to install WMF 4.0
We have two different Servers both running Server 2012 and are fully patched. When trying to install WMF/Powershell 4 we get the following error:One Server has TFS Server 2012 Installed(Server1). The...
View ArticleForEach Parallel doing VM Backups with TSM
Hi guys, Storage admin here.Wonder if you could help me with the following Powershell workflow. The objective is to run a backup per VM and wait for the result code to check if it needs to be...
View ArticlePowerShell Cmdlet Get-VMHostNumaNode, is not giving proper value for...
The cmdlet Get-VMHostNumaNode in not giving proper value for ProcessorsAvailability on Microsoft Windows Server 2012 R2Sample Output.PS C:\> Get-VMHostNumaNode -ComputerName ftvmmNodeId...
View ArticleError management in an event handler in a powershell form
Hi guysI wrote a powershell form using event handler. It ask for a name and a IP adress and other thingsIn the event handler, - if the user leave the name blank, I open a message box saying it should...
View Article