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

UserLDAP: Add/Remove functions and tests #259

Merged
merged 9 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions PowerFGT/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,55 @@ Function Confirm-FGTFirewallProxyPolicy {

}

Function Confirm-FGTUserLDAP {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)

#Check if it looks like a LDAP Server element

if ( -not ( $argument | get-member -name name -Membertype Properties)) {
throw "Element specified does not contain a name property."
}
if ( -not ( $argument | get-member -name secondary-server -Membertype Properties)) {
throw "Element specified does not contain a secondary-server property."
}
if ( -not ( $argument | get-member -name tertiary-server -Membertype Properties)) {
throw "Element specified does not contain a tertiary-server property."
}
if ( -not ( $argument | get-member -name server-identity-check -Membertype Properties)) {
throw "Element specified does not contain a server-identity-check property."
}
if ( -not ( $argument | get-member -name source-ip -Membertype Properties)) {
throw "Element specified does not contain a source-ip property."
}
if ( -not ( $argument | get-member -name cnid -Membertype Properties)) {
throw "Element specified does not contain a cnid property."
}
if ( -not ( $argument | get-member -name dn -Membertype Properties)) {
throw "Element specified does not contain a dn property."
}
if ( -not ( $argument | get-member -name type -Membertype Properties)) {
throw "Element specified does not contain a type property."
}
if ( -not ( $argument | get-member -name username -Membertype Properties)) {
throw "Element specified does not contain an username property."
}
if ( -not ( $argument | get-member -name password -Membertype Properties)) {
throw "Element specified does not contain a password property."
}
if ( -not ( $argument | get-member -name secure -Membertype Properties)) {
throw "Element specified does not contain a secure property."
}
if ( -not ( $argument | get-member -name port -Membertype Properties)) {
throw "Element specified does not contain a port property."
}

$true
}

Function Confirm-FGTVip {

Param (
Expand Down
Loading
Loading