I am trying to add some authenticated users (with the name from $description) to my FTP server using Powershell, but I can't figure out how to do it. This is the code I am trying to use:
Invoke-Command -ComputerName WIN-SERV2 -ArgumentList $description -ScriptBlock { Add-WebConfiguration -Filter "/system.ftpserver/authorization/*" -Force -Location '$FTPserver/$VDir' -PSPath 'IIS:\Sites\$FTPserver' -Value (@{accessType='Allow';permissions='Read,Write';users=$args[0]}) }
When I run the code nothing happens on the IIS server, the user is not in the authorization rules. I do not get any errors.
The server i am running this on is my domain contoler because I am creating other files and things. I am able to acces the FTP server from my domain controller because I can create a folder on the FTP server.
Bouth server are running windows server 2016, but are not connected to the internett.
I dont know what more info to give but just ask if you need more!