ubuntu resolute
This commit is contained in:
26
PS1/getuseringroup.ps1
Normal file
26
PS1/getuseringroup.ps1
Normal file
@@ -0,0 +1,26 @@
|
||||
# Définir l'URL de l'API avec le paramètre 'group'
|
||||
$groupName = "admin" # Remplacez par le nom du groupe que vous souhaitez interroger
|
||||
$apiUrl = "https://localhost/action/getuseringroup?group=$groupName"
|
||||
|
||||
# Définir la clé API si nécessaire
|
||||
$apiKey = "TOKEN" # Remplacez par votre clé API
|
||||
|
||||
# Ignorer les erreurs de certificat SSL non valide
|
||||
Add-Type @"
|
||||
using System.Net;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
public class TrustAllCertsPolicy {
|
||||
public bool CheckValidationResult(
|
||||
ServicePoint srvPoint, X509Certificate certificate,
|
||||
WebRequest request, int certificateProblem) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
"@
|
||||
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
|
||||
|
||||
# Envoyer la requête GET à l'API avec la clé API dans les headers
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -Method Get -Headers @{ "x-api-key" = $apiKey }
|
||||
|
||||
# Afficher la réponse de l'API
|
||||
$response | Format-List
|
||||
Reference in New Issue
Block a user