Quantcast
Channel: The Official Scripting Guys Forum! forum
Browsing all 15028 articles
Browse latest View live

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 Article


How 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 Article


detect 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 Article

conditionally 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 Article

Script 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 Article


Problem 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 Article

how 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 Article

script 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 Article


Delete 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 Article


powershell 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 Article

Math 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 Article

New 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 Article

Am 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 Article


ie version

Hi Scripting GuysHow do I write a script to get internet explorer version from all machines in our domain.Thanks

View Article

Invoke-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 Article


vbscript 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 Article

Continue 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 Article


How 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 Article

Script 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 Article

Find 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
Browsing all 15028 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>