Should I be able to compare string with system.string?
Should I able to compare these two arrays using the compare-object command given the IP of one is a "string" and the other is "system.string"? If so how? I'm trying to check that all values in...
View ArticleWindows Powershell Logs truncated
Hi Team,First let me brief you about my curent setup:1. I have 1 domain controller and 3 domain machines. (All in VM). one od the domain machine server 2012 R2 is working as windows event collector and...
View ArticleWindows Server 2008 R2 - PowerShell 2.0 - Delete a User Name or Group on...
Hello.I have a very big problem on Windows server 2008 R2 and PowerShell version 2.0.I am trying to delete “Everyone” and add new users on Shared Folders, specifically on Share Permissions tab, but the...
View ArticleSigntool Error: This file format cannot be signed because it is not...
If I want to sign the file locally everything works. However, if I want to sign the file on the web server, the following error "Signtool Error: This file format cannot be signed because it is not...
View ArticleHandle password not as plaintext in the script
I need to work with password in a powershell function. I am getting the password using the below code$credentials=Get-Credential $p=$credentials.GetNetworkCredential().PasswordThis way the password is...
View ArticleSplit the string
Below is the code I am running:Get-AzDataFactoryV2Trigger -ResourceGroupName "myrg" -DataFactoryName "myadf" | Select-Object Runtimestate, Properties.split(".",5)Values in properties:...
View ArticleProblems with get-scheduledtask
I'm monitoring multiple 2012 R2 servers (all deployed roughly at the same time) task scheduler where I use get-scheduled task within Invoke-Command to pull information on specific tasks. On one server...
View ArticleIt keeps prompt me to enter password
Here is my code but it keeps asking me for password instead of inserting the password $Users = Import-Csv -Path "c:\csv\test.csv" $UserPassword = ConvertTo-SecureString "Pa$$w0rd!" -AsPlainText...
View ArticlePowerShell - Query Event log Remotly
Hi,We have a basic script which query the event log in the DCs and in the local exchange server.These are the commands:1) ExchangeGet-EventLog -ComputerName Exchange_Server -LogName "MSExchange...
View ArticleMerge adjacent columns in a csv file into a single column and cell..
Hi All,I am trying to merge adjacent columns to one single column and one cell. (I want to create the History column- As shown in below screenshot)Can anyone pls provide the powershell script for the...
View ArticleHow to use DataGridView.Sort() Function in Powershell
what is the right way to use DataGridView.Sort() function in Powershell?I tried to run $DataGridView.Sort(3,'DESC') but got error. Thanks
View ArticleUse CimInstance to obtain make and model for systems across a domain
Right now i have all of the systems managed in a text file. I run :gc c:\allcomputers.txt | %{get-ciminstance -classname win32_computersystem}I receive a list of my local computers information. Is...
View ArticleDo you want to be acknowledged as Microsoft Windows PowerShell Guru? Submit...
What is TechNet Guru Competition? Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE...
View Articlehowto cut specific character or line
policy 1-TFS-DB-SQL\, schedule Default-Application-Backup,10/31/2019 02:57:31 - Info nbjm(pid=7116) requesting STANDARD_RESOURCE resources from RB for...
View ArticleSecure password when using powershell remoting
I want to set a new password on a service account on some remote computers. Currently I am using $using to transfer the password variable to those remote computers and set the new password on the...
View Article$DataGridView.Sort() - Sort by 2 columns
I am able to use $DataGridView.Sort($DataGridView.Columns[3],'Descending') to sort by Column 3, thanks for Jrv's help. Is there a way also to sort by another column after sorted by Column 3? Thanks.
View ArticleBitsTransfer Odd Filenames?
Hello,I'm using the following code to upload a file from the local machine to a remote server:Start-BitsTransfer -Source "$pdfName" -Destination "$destinationPath" -Priority Foreground -TransferType...
View ArticleSaving the Export-CSV filename to a variable?
My brain has gone to mush this morning!I would like to save the name of the exported file below into a variable, so I can add this to an array. The reason behind this is because I am using a date and...
View ArticleDeleting files of different extension type
Hi All.I have the script below.get-childitem "D:\files" -recurse -force -include *.dat *.avi | remove-item -force The above doesnt work on .dat and .avi file typesI would like to convert it to a...
View ArticleInvoke-WebRequest to download in-browser pdf
Hello,I'm trying to figure out how to download a pdf from a url. I've tried the following code, however the file is always corrupt. When I put the url in a browser, it shows the pdf inline with the...
View Article