Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ad_gpo_security http response error: 401 - invalid content type #185

Open
JW623 opened this issue Dec 14, 2023 · 0 comments
Open

ad_gpo_security http response error: 401 - invalid content type #185

JW623 opened this issue Dec 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@JW623
Copy link

JW623 commented Dec 14, 2023

terraform {
required_providers {
ad = {
source = "hashicorp/ad"
version = "0.4.4"
}
}
}
provider "ad" {
winrm_hostname = var.hostname
winrm_username = var.username
winrm_password = var.password
winrm_use_ntlm = true
winrm_port = "5985"
winrm_proto = "http"
winrm_insecure = false
}
resource "ad_gpo" "gpo" {
name = var.gpo_name
domain = var.domain
}
resource "ad_gpo_security" "gpo_sec" {
gpo_container = ad_gpo.gpo.id
password_policies {
maximum_password_age = var.minimum_password_length
}

system_services {
service_name = var.service_name
startup_mode = var.startup_mode
acl = "D:AR(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;LA)"
}

system_services {
service_name = var.service_name2
startup_mode = var.startup_mode2
acl = "D:AR(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;SY)(A;;CCLCSWLOCRRC;;;IU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"
}

}

Error: error while writing ini file to "\\trustrtestDC.com\SysVol\trustrtestDC.com\Policies\{6FD49D26-75FE-4E44-ADA5-502BE68EA6C2}\Machine\Microsoft\Windows NT\SecEdit\GptTmpl.inf": Error uploading file to $env:TEMP\winrmcp-5e93b190-66a5-4ed6-5e2d-737cd1a57b34.tmp: Couldn't create shell: http response error: 401 - invalid content type

│ with ad_gpo_security.gpo_sec,
│ on ad_gpo_security.tf line 22, in resource "ad_gpo_security" "gpo_sec":
│ 22: resource "ad_gpo_security" "gpo_sec" {

I got this error while running ad_gpo_security. I double checked my configuration and its all correct. I did tried all of the functionality like gpo, gpo membership, ad computer and so on from the official web, all went well only getting error for this. Any solution? thanks in advance!
PS : yes trustrtestDC.com is my domain

@JW623 JW623 added the bug Something isn't working label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant