Iterating/Executing TSQL-Scripts in Subfolders throws an error
Hi Forum,the idea: I have several subfolders containing tsql-scripts. I want to change into a folder and execute every script - sorted by name (important because of dependencies). I have an array with...
View ArticleCheck State of Scheduled Task
Hi,I am newbie, and am trying to a find a way in Powershell that can do the following:Conect to multiple computersCheck the state of a scheduled taskIf the task is disabled, enable it and log it to a...
View ArticleMake unzip scrip run on another machine
H i all so I came up with this little script. It's very unoptimized and I want to make the unzip part into a function. My main question is I'm copying this zip folder to another machine. Will it...
View ArticleUsing Import-StartLayout to a local system
Here is states, that this cmdlet can be used only to an image: http://technet.microsoft.com/en-us/library/dn283403.aspxBut his guy claims that this cmdlet can be used locally:...
View ArticleHow do I sort on a Hash Table value?
Hello,I execute the following which lists Computer objects which have not be logged into for over 30 days. I want to sort by the LLTS field, or Ascending with oldest first. How is this...
View ArticleYet one more attempt at automate licensing of Exchange
I've been trying to automate the licensing of Exchange 365 and Lync for the benefit of our sub-admins who aren't global admins. Normally I manually run a script like:$License =New-MsolLicenseOptions...
View ArticleCheck if IIS running on a remote server
Hi, I need to check if IIS is running in a remote server. This is what I have collected from web, but not working. Even though IIS is running in the remote-server, but this check always saying "Not...
View Articlelisting AD accounts that been inactive for more than 90 days, or that shows...
Hi, I am trying to get information about more than 90 days, could someone verify script below, is it fine or I should add anything else$90Days = (get-date).adddays(-90)Get-ADUser -properties * -filter...
View ArticleComplex XPath conditional
I am trying to SelectSingleNode based on three conditions. ID and Type apply only to the outer node. But Context could apply to either the outer node or an inner node. So these should be...
View ArticleDrag drop of button
I am new to powershell. I want to drag a asp button and drop it in div dynamically. Can you please help me in this.Thanks in advance.
View Articleoutput csv file is overwritten when using loop in powershell for input
Hi,I am running this script which is gathering the info for all users from input file but only the last users data is exported to the output file.import-csv .\users.txt | foreach-object{...
View ArticleGet-ADuser and Import-CSV problem
Hi everyone! im trying to run script but i receive only last 4 users information from CSV file. What about others objects?Of course the output users from CSV are present in Active...
View ArticleA central backup system based on PowerShell
The databases in our system are backed up today not systematically using ad hoc Jobs: in order to backup database MyDB in server MyServer we create a Job in MyServer and define when, what (DB) and...
View ArticleRename Filename removing end-part
Hi, I have around 200 txt files in a directory, all files have a "_" and a datestamp in the end of the filename. Is there any single-line command available that i can use to eliminate the "_" +...
View Articlecopy-item not overwriting exising files but creating additional subfolder.
Hello, A simple bit of code does not do as expected:copy-item "C:\folder1\*" -destination "\\server1\share1\folder2" -recurseI would expect this to copy all files from c:\folder 1 to the destination...
View ArticleHow does $(......) work?
Hello,Can someone plz explain and provide references to how $(....) works below and why we use it.$mycred = Get-Credential$CompName = Read-Host -Prompt "Enter Computer Name"Write-Debug "user name:...
View ArticleHelp with PSexec command
Hi everyone so I have this script that pulls a file from another machine and then unzips it.function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip =...
View ArticleGet renamed file new name
Hello all. What I'm wanting to do is rename a file and then do some things with the new file name.1. I want to view the new file name with the full path2. I want to output the new file name with the...
View ArticleRight click and "Run with PowerShell" Evasive Error
Hi, I create scripts for others to use. They do not know powershell, but can right click and run. It's hard to support a script if the user can't see the error long enough to read it. It's also hard...
View ArticleNew-SPConfigurationDatabase : Microsoft SharePoint is not supported with...
I'm using the AutoSPInstaller from codeplex and now recieve this error. Is this a problem of my server or is it something I defined wrong in the configDB?The following is my signature:Powershell...
View Article