• RSS
  • Twitter
  • FaceBook

Welcome to ISAserver.org

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

FPCPolicyRule - ftp upload blocked by default?

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [ISA 2006 Misc.] >> ISA 2006 Programming >> FPCPolicyRule - ftp upload blocked by default? Page: [1]
Login
Message << Older Topic   Newer Topic >>
FPCPolicyRule - ftp upload blocked by default? - 8.Dec.2010 10:47:35 AM   
FlushNorris

 

Posts: 2
Joined: 8.Dec.2010
Status: offline
Hey,

I've got a project where FPCPolicyRule's is being created with .net(C#) through FPCLib, now i've become aware of an additional setting which is only able to be altered when the rule has been saved e.g. FTP regarding uploads is being blocked by default, that may be good for some rules. But how do i find/change that setting api-wise?

I became aware of the additional setting on...
http://www.elmajdal.net/isaserver/Allowing_FTP_Uploads_Through_ISA_Server_2004_2006.aspx

There is also additional settings for HTTP and RDP, which also would be nice to know where they are stored.

Regards
Nikolaj Strauss
Post #: 1
RE: FPCPolicyRule - ftp upload blocked by default? - 14.Dec.2010 7:05:27 AM   
parseint

 

Posts: 12
Joined: 28.Sep.2010
Status: offline
I've got the exact same problem, I'm using vbscript, didn't know there was a c# lib. Where can I find this lib?

(in reply to FlushNorris)
Post #: 2
RE: FPCPolicyRule - ftp upload blocked by default? - 14.Dec.2010 7:31:57 AM   
parseint

 

Posts: 12
Joined: 28.Sep.2010
Status: offline
Hi, I figured it out, take a look at:

http://msdn.microsoft.com/en-us/library/ff823963(VS.85).aspx

(in reply to FlushNorris)
Post #: 3
RE: FPCPolicyRule - ftp upload blocked by default? - 14.Dec.2010 8:18:24 AM   
parseint

 

Posts: 12
Joined: 28.Sep.2010
Status: offline
Was a little hassle to figure this one out code-wise, but here's how to disable the read-only mode:

const FTPFilterGUID = "{680A928F-22B3-11D1-B026-0000F87750CB}"
const RuleName = "Some rule"

Set fso = CreateObject("Scripting.FileSystemObject")
Set rule = GetPolicyRule(RuleName)
Set vpSets = rule.VendorParametersSets

Set vpSet = vpSets.Item(FTPFilterGUID)
vpSet.Value("BOOL_VALUE") = "FALSE"
vpSet.Save

function GetPolicyRule(ruleName)
Dim root
Dim rules
Dim errorCode, errorDescript

Set root = WScript.CreateObject("FPC.Root")
Set rules = root.GetContainingArray.ArrayPolicy.PolicyRules
On Error Resume Next
Set GetPolicyRule = rules(ruleName)
Select case err.Number
case Error_FileNotFound:
WScript.Echo "The policy rule " & ruleName & " could not be found."
WScript.Quit
case 0:
' OK
case Else
err.Raise err.Number,, err.Description
End Select
On Error GoTo 0
End Function

< Message edited by parseint -- 14.Dec.2010 9:07:27 AM >

(in reply to parseint)
Post #: 4
RE: FPCPolicyRule - ftp upload blocked by default? - 14.Dec.2010 9:05:48 AM   
parseint

 

Posts: 12
Joined: 28.Sep.2010
Status: offline
I forgot to add the vendor set if it doesn't exist, here's the code for doing that:

sub AddVendorSet(ruleN, guid)
'Define the constants needed.
Const Error_FileNotFound = &H80070002

Dim rule, vpSets, vpSet

set rule = GetPolicyRule(ruleN)
Set vpSets = rule.VendorParametersSets

' Try to retrieve the required vendor parameters set.
' If it does not exist, create it.
On Error Resume Next
Set vpSet = vpSets.Item(guid)
If Err.Number = Error_FileNotFound Then
Err.Clear
WScript.Echo "Creating the required vendor parameters set..."
Set vpSet = vpSets.Add(guid)
If Err.Number <> 0 Then
WScript.Echo "An error occurred: 0x" & Hex(Err.Number) & " " & Err.Description
WScript.Quit
End If
Else
WScript.Echo "The vendor required parameters set already exists."
End If
Err.Clear
On Error GoTo 0

' Set the value of the parameter.
vpSet.Value("BOOL_VALUE") = "FALSE"

vpSet.Save
WScript.Echo "Done adding vendor set!"
End Sub

< Message edited by parseint -- 14.Dec.2010 9:06:59 AM >

(in reply to parseint)
Post #: 5

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [ISA 2006 Misc.] >> ISA 2006 Programming >> FPCPolicyRule - ftp upload blocked by default? Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts