Microsoft Internet Security and Acceleration Server 2000 |
The following is a portion of C++ code that adds a new schedule called "Extended Work Hours", which includes all hours on all days. This code was written as a Windows Console Application. To use this code:
//Import the ISA msfpccom.dll file so that ISA COM objects can be used. //Use the path to your ISA installation directory, or search for msfpccom.idl #import "d:\Program Files\Microsoft ISA Server\msfpccom.dll" int main () { // Define variables. HRESULT hr; //Initialize the COM library on the current thread. hr = CoInitialize( NULL ); { // Define variables. FPCLib::IFPCPtr sipFPCRoot; FPCLib::IFPCSchedulesPtr sipMyScheduleCol; FPCLib::IFPCSchedulePtr sipMySchedule; // Create the ISA root object. hr = sipFPCRoot.CreateInstance("FPC.Root"); //Get the schedules collection. sipMyScheduleCol = sipFPCRoot->Arrays->GetContainingArray()->PolicyElements->Schedules; //Add the schedule. sipMySchedule = sipMyScheduleCol->Add("My New Schedule"); //Set the schedule sipMySchedule->Set(FPCLib::fpcALL_WEEK, FPCLib::fpcALL_DAY); //Save your changes. sipMyScheduleCol->Save(); } CoUninitialize(); return 0; }
FPCSchedule, Modify a Schedule