How to pipe ScriptPath results to execute login script
$script = Get-ADUser $env:Username -properties Scriptpath | Select-Object scriptpath \\domain.local\netlogon\$scriptAbove is example of what I would like to work. Basically, I'm taking the Users login...
View ArticleSplit names
I have got a series which could contain the following values:Jansen RJansen - van der Vries VJansen - de Kip Q vanJansen - Haar W deIk would like to get the highlighted values into a separate string. I...
View ArticleParsing of Message field of Event Log entry using PowerShell
I want to do parsing of the windows security logs using Powershell,I want to select only Time, Account Name, Network Address, kindly suggest me.Get-WinEvent -LogName Security | Select-Object -First 1 |...
View ArticleCompress files
Hi All, I have a folder with many logs in it, I want to compress all log files with name starting abc older than 8 days and delete all files older than 9 days in vbscript .vbs file. I am able to only...
View ArticleCreating Optional Parameter in Powershell Function
I'm attempting to create a function with an optional parameter (called a switch?) that will export the results to a .csv. Below is what I've managed to cobble together and it mostly works. If I don't...
View ArticleI am trying to find all users that have a valid email.
# Get-ADUser -filter "msExchUserAccountControl -eq '0'" | Select-Object SamAccountName | Export-CSV -Delimiter `t -NoTypeInformation -Path "c:\files\MAILAR.csv" #Get-ADUser -filter...
View ArticleHow to add images to the email body of my powershell script.
I have a PowerShell script to notify users when there password is about to expire. I would like to imbed these images into the email but I am having a hard time figuring it out. Below is the code and...
View ArticleDCOM Permissions & Powershell.
Hello,I am attempting to write an automated method to pull permissions for all objects in a specific installed application. I am leveraging accesschk.exe (sysinternals) to pull the effective...
View ArticleShow size of folders using powershell
I have a task I need to do, which is get a list of user profiles and show how large the profile folders are in size, preferably megabytes or what ever. I am a bit rusty on getting this info and hoping...
View ArticleAdding to the details pane in file properties
I couldn't figure out where to put this question, so I apologize if this is the wrong place, but I am trying to get extended file details in the details tab when I click on a file's properties....
View ArticleHow to catch the OpenError when removing and adding DHCP reservation
Hi,Got a script which "walks" through all IP reservations in a given Scope and rewrites them to another ones within the same Scope. I am using the Remove-DhcpServerv4Reservationand right after...
View ArticleQuery AD-Computers for Managed-by with deactivated users
Hello community,I need to query AD for computer-Objects that have no Managed-by-entry or that have Managed-by-entries with a deactivated user.I know how to query empty Managed by, but how can I query...
View Articleread output of a powershell script using C++
Hi All,I am calling a PowerShell script in a C++ program. PowerShell script creating a text file. When C++ program reading this file, may be due to format or some other problem, content was not...
View ArticleOut-File to variable
HiI wrote a script that needs to have the output displayed on an html page. I currently have it creating an html file then opening it. Is it possible to have it store the information in a variable,...
View ArticleRemote script execution - Avoid log-in prompt
I am trying to run commands(Ex:delete a file) with alternative credentials(explicit user name and password which is hard coded in the script) in windows 2012 Azure virtual machine. After searching...
View Articlefiles to be moved to month folder
Hi, I have 4 files here c:\test25-10-16_test1.txt25-9-16_test2.txt25-8-16_test3.txt24-8-16_test4.txtI would like to make a script that will move the files into folders named the month.The timestamp is...
View ArticleVBScript running command line program (blat) works only once
All I am running blat from VBScript. There could be many files with different extensions passing through on a given run. I am using a loop to process each file. It works the first time through, but...
View ArticleVBScript : How to write different type of data in the same file ?
Hello,Using VBScript (only), How to write different type of data in the same file ?I mean by example : --------------------------------------------------------------------------------------------DIM...
View ArticleConfused about context
I'm not a programmer and need some help with scripting an export from AD in PowerShell.The following command returns a list of all users who have "tvstation" set as their company field.get-aduser...
View Articletool for Unix Shell scripts to powerShell scripts
Hi,Do we have any tool to convert from unix shell scripts to power shell scripts?thanks in advanceVenkatta
View Article