Powershell - last logged on user - same input, different output
I remote into another server to run a powershell script that displays the last logged on user.Several thingsIt only works when I run it in the context of a service account, not the AdministratorIt...
View ArticleHow can I use select-string to only output last phrase in file
So I'm trying to run a script that searches a particular file for the phrase "Default Printer: PRINTERNAME". What I have so far is: cls $file = "c:\temp\print.log" Select-String -pattern "Default...
View Articledetect x32 system
Hi I have this script but I need to modify it to display data if the system is x32. ForEach ($system in (Get-Content C:\computers.txt)) { # It's easier to have file path in a variable $dll =...
View Articleconditionally executing 2nd command
helloi want to write a windows batch file so that system first checks if preferred DNS server is set (exist) in NIC IPV4 settings, system continues executing the next command (which isnetdom join...
View ArticleScript to block IE10 and 11 update and block auto update of Java on users...
Hi Friends, I am working with a new company where IT infrastructure is still immature. Let me tell you why., The company deploys a machine with no centralized software deployment inplace for update of...
View ArticleProblem understanding enumkey method always getting "Object Not a Collection"
Hi Guys. I usually find lots of information to help within the existing posts but this one is eluding me :(I'm having a problem with this code.when i try to lists the contents for akeys (list of keys...
View Articlehow to determine if a DocumentElement.Selectnodes is invalid or not present
Hi Guys, I'm parsing a xml event log file for a certain eventid, and within that even i need to read the volumeinfo and componentinfo element. there is always a volumeinfo, but in certain cases an xml...
View Articlescript to change users' primary SMTP address
Hi, i have csv file with list of 200 users name. all the 200 user's are having primary and secondary email ID. as per example :- user@smtp.co.in (as primary) and user@smtp.com (as secondary)i need to...
View ArticleDelete Aged Files & Folders from Subfolders
Hi,I have the following script to delete files and folders older than 7 days. It work but I need to be able to go through subfolders as well: Set objFSO = CreateObject("Scripting.FileSystemObject")Set...
View Articlepowershell script modification help
i have powershell script available. it changes advertisement schedule. I am looking some one to modify the script. $d=New-CMSchedule -Start "8/11/2014 1:00 PM" -Nonrecurring Set-CMPackageDeployment...
View ArticleMath function (for use in PS script) to determine exact 5 minute intervals...
This is more of a math question than PS, but I am wondering if anyone has seen or created a math function that will determine the next 5 minute time slice from starting at the top of the last hour....
View ArticleNew to Script writung
I am new to script writing and would like to know of books or articles that I could peruse to begin learning. Need to write basic search and search/replace scrripts for various MS applications.Thanks!
View ArticleAm getting "@{01test=addr1} when I should be getting ... well, just "01test"
Am working on a script to pull PrimarySMTPaddress based on WindowsLiveID. I have a csv file of WindowsLiveIDs. I save the contents variable $List = import-csv -path path\file.csv ... The next step is...
View Articleie version
Hi Scripting GuysHow do I write a script to get internet explorer version from all machines in our domain.Thanks
View ArticleInvoke-WebRequest slower than expected.
I'm measuring how long it takes to download a file, then doing some math to figure out the speed of the download.I'm finding that by using Powershell, I'm getting results of around 6.5MB/s. If I us...
View Articlevbscript search for string within string not working if filename contains a...
Hello, I am hoping this is just something simple I missed but everything tried so far doesnt work.I have a folder containing a list of files. What I need to do is read a text based file that contains...
View ArticleContinue script ONLY if a D drive is found???
I'm working on a deployment script and i want to put in a validation part that will look for a D drive and if not found, throw up an message telling them to create one before continuing.Now I have...
View ArticleHow to get repitative group a user is member of
Hi,i have a user in our domain who is member of number of groups. This means in MemberOF tab of the user there are larg number of groups. Now i want to remove some groups which are repitated.Example -...
View ArticleScript for copying or moving files from windows server to another remote...
Copy below 2 line into notepad and save as movescript.vbsexecute in command promptc:\cscript movescript.vbs (Press ENTER)Files will move to remote location.=========================================Set...
View ArticleFind default printer for list of remote XP and Win7 pc's
So I'm ready to pull my hair out... I've been asked to create a csv file that shows the default printer for each workstation. This is a monumental feet and from what I've seen online (and try myself)...
View Article