I want to be able to use Get-WebConfiguration to be able to retrieve what user/users have access and use an If /Else block to be able to add the users if they don't already exist. I cant seem to come up with the correct syntax to make this work??
I can use this and it will get the users and their permissions:
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
3 Posts
FTP - Get-WebConfiguration to retrieve details of users
Feb 14, 2021 12:25 AM|pelagos|LINK
Hi ther
I am using this command to set the users access on an FTP site
I want to be able to use Get-WebConfiguration to be able to retrieve what user/users have access and use an If /Else block to be able to add the users if they don't already exist. I cant seem to come up with the correct syntax to make this work??
I can use this and it will get the users and their permissions:
How do I format this to be able to get the actual users in an If /Else statement?
Basically - If user already has access move on Else "Add-WebConfiguration....."
Thanks
pelagos
1616 Posts
Re: FTP - Get-WebConfiguration to retrieve details of users
Feb 15, 2021 02:35 AM|Jalpa Panchal|LINK
Hi,
You could try to store the value of the user and permissions in variable and in if condition you can check that values.
you could refer to below post for reference:
https://stackoverflow.com/questions/47673926/check-whether-iis-is-installed-or-not