Forloop does not continue if cmdlet fails
Dear All,pretty new to powershell, might be a simple question, i'm trying to iterate a list of computers to find event logs and store them in an array, however if get-winevent fails for somereason, the...
View ArticleReplace AD Usern Import CSV
Hey experts,I get a replacefor some users but in some, this works.Error: Set-ADUser : replace In C:\Users\Administrator\Desktop\Powershell\Import_bearbeiten.ps1:3 Zeichen:1+ Set-ADUser -Identity...
View Articlesend email with CSS not working
I am trying to send email using the below function. On the email it comes without CSS.Can anybody please help meFunction sendEmail { Param([string] $Body) $smtpServer = "mailhost.lsg" $smtpFrom =...
View ArticleScheduled PowerShell Task
I'd like to schedule a PowerShell task, have it pull 1 column of data from MySQL database and execute another PowerShell command on that data. Is this possible? Would you be kind enough to provide...
View ArticleCalling a PS script from VBA with parameter
hi i try to call ps script that take input and return the value in exel sheet using VBAbut i have problem when i try to call and pass the parameter to the script .powershell return this error...
View ArticleSearch Folders for Match and Delete Folders That Don't Contain Match
Hello, I have about 8 folders that have various things copied into them throughout the day (Event vwr logs, text files, and .dmp files). What I am trying to figure out is how can I write a statement...
View Articlewhats the '#' in the TypeName tag in ps1xml files?
Hello, Curious, I see the use of '#' character in TypeName (child of ViewSelectedBy element of a View in ps1xml files).. for example:MamlCommandHelpInfo#relatedLinksI also see it used when wmi classes...
View ArticleImport-Pssession is not importing cmdlets when used in a custom module
I have a PowerShell script/function that works great when I use it in my PowerShell profile or manually copy/paste the function in the PowerShell window. I'm trying to make the function accessible to...
View ArticleExport errors to html or txt file
I'm trying to run this command for every user to verify they have an account. Get-MSOLUser -UserPrincipalName joe.user@mycompany.comI would like to run this from a csv file and just export the errors...
View ArticleFind Username By UPN In Powershell with Imported Active Directory Module
Hello all,The issue I am having involves a user that uses a CAC to log in to a domain. When the account is created, a 10-digit number printed on the CAC is associated with the users account and...
View ArticleVisualBasic InputBox Problem
Hello All,For my first post ever on the TechNet forums, I wanted to thank you all in advance.My issue is quite odd. The script I created to show an inputbox works fine when ran from the command prompt....
View ArticlePowerShell script performance
Hello all,I have been asked to write a script to list all the success and failures of daily backup exec task from remote servers (by querying the Windows Event log) and I have put together the below...
View ArticleBest way to tell if 2 strings are equal
Hi all so I'm trying to see if 2 strings are equal to each other. For example if CEIT2551202X038 is equal to CEIT2551202X038. I have tried -eq , .equals , and .compareTo with no luck. Also I cannot use...
View ArticleDo we have any certification on powershell?
Do we have any certification on powershell?Like MCSE.Regards~BiswajitDisclaimer: This posting is provided & with no warranties or guarantees and confers no rights.MCP 2003,MCSA 2003, MCSA:M 2003,...
View ArticleIssues when attempting to create a new 2012 R2 forest through powershell
Hello,I've been writing a script to automate the installation of some new servers, however I'm experiencing an issue when I'm coming to create the forest, for some reason the $DomainName and $ADSecPwd...
View ArticleNo changes to CSV file using Scheduled Task
Hi, I have a very simple script that changes a CSV file. When I run this via a Powershell console it works fine but if I try to run it in a Scheduled Task no changes are made, though the task said it...
View ArticleExport-CSV as a different user
Wrote a sript to audit a few reg keys and other vitals from the computer. Eventually I will have this go to a database but in the meantime I am trying to write it to a text file. These are mobile...
View ArticleCalling DB2 Stored procedure(with parameters) from powershell
Hi I am trying to call a DB2 stored procedure that has parameters from Powershell scrip and I am not able to can some one help me...
View ArticleHow to know if the Win2012R2/Win8.1 April Update is installed?
I found a way to do that, based on information form technet and was trying to do using WMIC, but i found that it´s easy using powershell"...To confirm the exact version of Windows Server 2012 R2 that...
View ArticleProblems Using Code from Newer PowerShell Versions in Version 2
I use the PowerShell ISE, running version 4, on my workstation, and I write scripts there. I often copy the code back and forth to OneNote, using this script to copy it with formatting. This works...
View Article