test-path where a directory in the path is variable
My company has a series of fax lines and associated file shares. Faxes are processed & then dropped off into these file shares. From that point a service runs about every 60 seconds to look for...
View ArticleNeed Help - Batch File
This Script works well on Clean install but if it has an old version and I want it to check the variable gets broke someone in batch... I can type it in Command line and it works.Script:@echo off REM...
View ArticleVB Script to move a file with date in name
I'm so stuck but I know Im close. So its friday and I'm brain dead and I'm asking for some help please.I have FILES starting with dates140729HDF0.835140730HES0.835140731UHG0.835and I need to move the...
View ArticleAdding child nodes to existing nodes in XML using Powershell
I have the following XML structure:<ovf:Envelope> <References> </References> <DiskSection> </DiskSection> <NetworkSection>...
View ArticlePowerShell Workflow: Returning $PSCredential from function
Greetings All,When using PowerShell Workflows, I have a function which returns a $PSCredential object, and workflow code that assigns the return to a variable. The function call enters and exits...
View ArticleoShell.run query
Hi allGo easy on me - trying to make move from batch to *.vbs. It's going ....ok.... so far. Most of the *vbs is working except:Dim oShell Set oShell = WScript.CreateObject ("WScript.Shell") oShell.run...
View ArticleSchedule Task within script
I am trying to create a task with very specific options:This is how I create it from a CMD line:schtasks /create /tn "Taskname" /tr "\"C:\Program Files\Program1\Program2\Start.exe\"/T" /sc daily /st...
View ArticleVB Script error - when try to execute a command on windows shell
Hi ,I had to create a scheduled task on a specific date - I tried using schtasks It worked well!.SCHTASKS /create /tn "Mytask" /tr "cscript "C:\Remove.vbs"" /sc ONCE /sd 08/02/2014 /st 14:25 /RL...
View ArticleVBScript Update Multiple Reg Keys
HiI am looking to develop a vbscript that first check if the registry keys exist, and second if the value exist ignore to do any updates. But, if the values do not exist to perform an update.Const...
View ArticleEvent Log Content Email through Scheduled Task in Windows 2012
Hi,I am Using Attached Event to Task Scheduler on Many Windows 2008 Servers , When Someone logged in through remote desktop , I am getting an email with Server Name , User Name and Machine IP from User...
View ArticlePowershell export
Morning, Sorry I am new to using powershell - it is a simple script to provide me a folder structure and files in a particular drive. I am struggling to work out why anything I try it will not export...
View ArticleHow do I know if the user is belong to Mail Restricted Group/s? Do anyone...
Hi Guys, Good day, I'm new in powershell scripting. Will someone can help me about my problem?Thanks.
View ArticleSchedule Task within script for import module
Hi,Unable to powershell script in Scheduled task. I have added the import AD module in the powershell script.Every time I need to login into Windows 2008 R2 server and then the script runs...
View ArticleProblem importing a module and finding it's commands?
Hi, I have a problem. I'm trying to import the DFSR module and use it's commands in my PS session.But, I can't get the commands to show. I've looked in my system32 directory and I can see the DFSR...
View Articleconvert lastlogon date value (1/1/1970)
how to convert lastlogon valueSet objWMIService = GetObject("winmgmts:\\.\root\cimv2")Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkLoginProfile")Dim objLastLogonFor Each objItem...
View ArticleVBScript to read from Excel, search AD and put a value back into Excel
I have an Excel spreadsheet that contains a list of hired and terminated Employees. What I would like to do is take the employeeid from only the terminated employees, search AD, and return whether the...
View ArticleChange CDROM drive letter based on objItem.DeviceID
Good start was in: http://blogs.technet.com/b/heyscriptingguy/archive/2011/03/14/change-drive-letters-and-labels-via-a-simple-powershell-command.aspx but does not actually seem to work (Win 7...
View ArticleSystem DSN not visible in ODBC Control panel
I am creating system dsn at run time using VB code to connect to database. My vb code makes entries in following registry key to create the dsn HKLM\SOFTWARE\ODBC\ODBC.INI. But I cannot see the actual...
View ArticleHow to stop the rename the cn again if it had meet the condition
How to stop to rename the CN in Active directory if running the script.This is my script:$objSearch = New-Object DirectoryServices.DirectorySearcher $dateNow = Get-Date $DomainDNS =...
View ArticleHow to change dns setting using powershell
Hi every one, I am really confused where to start from I would like to populate just two fields in network adapter setting. those two fields are preferred DNS and alternate DNS. The ip will be...
View Article