Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

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 Article


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


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

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

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


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

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

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


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


Image may be NSFW.
Clik here to view.

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

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

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

Image may be NSFW.
Clik here to view.

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


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

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

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


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

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

Invoke-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
Browsing all 21975 articles
Browse latest View live


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