Answer the question
In order to leave comments, you need to log in
How to make automatic windows authorization on powershell?
There is a certain resource from which it is necessary to obtain information. The resource has Windows authorization, and it is rather peculiar. Another "feature" of this resource is the inclusion of a resource for a given time interval. For authorization, I use the following script; its drawback is that it simply inserts credentials into the form and you need to confirm them manually, i.e. click on the "OK" button:
#Учетные данные
$user = 'login'
$pass = 'superpass'
$secureStringPwd = $pass | ConvertTo-SecureString -AsPlainText -Force
$credis = New-Object System.Management.Automation.PSCredential -ArgumentList $user, $secureStringPwd
#Куда подключаемся
$source = "https://Resource/"
#Подключаемся к ресурсу
$parce = Invoke-WebRequest -Uri $source -Credential $credis
#пошел запрос к серверу и тут от нас требуют подтверждение учетных данных
Answer the question
In order to leave comments, you need to log in
The question is closed. There was a problem with certificates, FQDNs and redirects on the remote server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question