Powershell to check uptime of servers
I am newbie for powershell. I got a script to check server uptime but I don't know1) how to output the result?2) how to change the path of computer.txt==foreach ($computer in Get-Content...
View ArticleAD Module for Windows PowerShell - Insufficient Access Rights to perform the...
I have a recently upgraded domain that's now running all 2008R2 DCs. The domain functional level is 2008R2 and the forest functional level is 2003. I've also created a brand new lab domain with...
View ArticleAssistance with bringing two scripts together
Hello,I have the following script that will successfully give me the IP address, DNS, Netmask, MAC Address etc for my VM's. I want to add to this script the following:To show free space for each drive...
View ArticleReboot a PC list
I thought this would be a simple command, but need assistance please. Trying to reboot/restart multiple PC's from a text file using this ps...
View ArticleError: "File cannot be loaded because the execution of scripts is disabled on...
Hello,I'm executing powershell scripts from command prompt. I've changed my execution policy to Unrestricted. Also, Get-ExecutionPolicy is showing 'Unrestricted'. When i execute following error"File...
View ArticleSFTP in Powershell
Hi,Can anyone please give me any guideline on implementing "Secure FTP" (SFTP) in powershell for FTP file transfers?
View Articlechange default logon page title for Windows PowerShell Web Access
I've installed Windows PowerShell Web Access on Server 2012 and it's working perfectly. However, I would like to change the default header on the logon page so that it reads 'My Company PowerShell Web...
View ArticleUpdate user account properties
HiCan someone help me to find out why I am getting the following error messages?Function SetL1CustomAccountProperties($ip,$vm,$acc) { $ErrorActionPreference = "SilentlyContinue" $Error.Clear()...
View ArticleCan someone help me convert this script to PowerShell?
:: This is the registry fix for installation in Windows 7. I'm referring to where the homedrive path is set to use the variable %homedrive%\%homepath% ::"\\wn1815\Desktop\KCDesktop\Tips and...
View ArticleDomain Controller System State backup script *not working*
Hello I am trying to get an automated backup for my domain controller to a network share using a script and windows task scheduler - our domain controller is windows server 2008r2 this is the code for...
View ArticleHow to Set a machine level Environment variable in remote machines
Hi,I have to set a List($ProjectName) as the value of an environment variable($PROJECTS).The cmdlet which I tried is :$remoteMachineList = 'machA', 'machB'$ProjectName = 'ProjA', 'ProjB', 'ProjC'...
View Articleread-host text box not working
Hello all ,i have few parameters in my function i am reading input using read-host but its not working i added comments to it buts not displaying comments too below is the sample code i was using...
View ArticleWhere am I going wrong? Simple 'Delete User' script with menu
Like the title suggests, the below script refuses to work despite trying many iterations.When running the script, after typing in the username and pushing enter it displays the details of every single...
View ArticleXPath predicate on wildcard
I am trying to get a (for me!) complex XPath expression working, and having trouble. If I use this it finds all nodes in the Arch Package Set, including Removals.$SetExpression =...
View ArticleIMHO, incorrect PowerShell behavior when dealing with...
function f{ [cmdletbinding()]param( [ValidatePattern("^[AB][CD][EF]$")] [ValidateNotNullOrEmpty()] [text.stringbuilder]$Data ) '--- function f' "Data is `$null: $($Data-eq$null)""Data=#$Data#""--- end...
View ArticleSetting BusinessCategory Attribute
Hi there,I need some help for updating some of the ad attribute. I have the following fileadtest2.csv which contain the following...
View Articleerror while install sql server 2012 using powershell
hello all,I am using below function to install sql server and its not working can some one help me please Function Install-Sql2012 {param([Parameter()][string] $Path ,#= (read-host "Enter...
View ArticleModifying existing script - modifying how data is written out to csv
I have an existing script written in Powershell 3.0 that gathers data from my virtual machines. It's working to give me the data, but I'd like to modify how it writes it out. Currently the data looks...
View ArticleDisable Remote Control for a user account on a remote computer
HiDoes anyone know how to Disable Remote Control for a user account on a remote computer??Thanks
View ArticleNew-Item -Force behavior
All the references I have found for New-Item say that using -Force will "overwrite" any part of the path that already exists, but my actual testing suggests this is not the case. I have created a Key,...
View Article