Autor Thema: Policy per Script auf Client sofort neu laden  (Gelesen 2099 mal)

Offline Ice-Tee

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 725
Policy per Script auf Client sofort neu laden
« am: 10.03.20 - 13:39:29 »
Hallo, es gibt ja die Möglichkeit die Policys im privaten Adressbuch mit der versteckten Ansicht $Policy anzuzeigen.
Wenn ein Client beim besten Willen die neuen Policys nicht laden will, welche Möglichkeiten gibt es?

Wenn ich es so machen, passiert nichts:

1. Alle Einträge löschen
2. Gibt es ein kleines Script, was auf dem Zielrechner ausgeführt werden

Auf folgender Seite ist das verwendete Script:
https://www.activelink.de/home/website.nsf/MainFrameset?OpenFrameSet&Frame=MainFrame&Src=%2Fhome%2Fwebsite.nsf%2F0%2F5e40b27c359f9b67c1257c61004f6ec0%3FOpenDocument%26AutoFramed

Hat jemand ein Script was funktioniert?
Oder eine bessere Variante?

Danke

Offline DomAdm

  • Senior Mitglied
  • ****
  • Beiträge: 359
  • Geschlecht: Männlich
  • Ich liebe dieses Forum!
Re: Policy per Script auf Client sofort neu laden
« Antwort #1 am: 10.03.20 - 14:39:38 »
Hallo,

ist in dem verwendeten Arbeitsumgebungsdokument das Feld "AcceptUpdates" auf 0 oder 1 gesetzt?
Wenn 0 dann auch keine Updates der Policies.

Das Feld wird gesetzt wenn die Arbeitsumgebung im Bearbeitungsmodus ist und kann über
"Aktionen -> Erweitert -> Aktualisieriungsflag setzen" geändert werden.

https://help.hcltechsw.com/notes/11.0.0/err_allow_admins_keep_loc_sets_r.html

« Letzte Änderung: 10.03.20 - 14:41:19 von DomAdm »
Jacob

Offline DomAdm

  • Senior Mitglied
  • ****
  • Beiträge: 359
  • Geschlecht: Männlich
  • Ich liebe dieses Forum!
Re: Policy per Script auf Client sofort neu laden
« Antwort #2 am: 10.03.20 - 15:27:30 »
Hab noch was gefunden:

Is there a programmatic way to ensure that a Notes client pulls down a policy? Is there a way to ensure that DCC runs programmatically?


Solution

Yes. If implemented programmatically, this is best done by attaching the code below to a button and sending it in an e-mail to each user.

The code below accomplishes the following:

1. Removes all documents in the hidden $Policies view in the personal Names & Address Book (NAB).

2. Removes the local calendar profile.

3. Sets the AcceptUpdates = 1 in the current Location Document.

NOTE: The code below is a sample script, provided to illustrate one way to approach this issue. It is to be used as is and at your own risk. In order for this example to perform as intended, the script must be laid out exactly as indicated below. Product Support cannot customize this script for specific environments or applications.

LotusScript
Sub Click(Source As Button)
Dim s As New notessession
Dim db As NotesDatabase
Dim currdb As NotesDatabase
Dim calprofdoc As NotesDocument
Dim locationdoc As NotesDocument
Dim policiesview As NotesView
Dim locationview As NotesView
Dim nviewentcoll As NotesViewEntryCollection

'remove calendar profile
Set currdb = s.CurrentDatabase
Set calprofdoc = currdb.GetProfileDocument("CalendarProfile")
Call calprofdoc.Remove(True)

' removes all entries from $Policies view
Set db = s.GetDatabase("","names.nsf")
Set policiesview = db.GetView("$Policies")
Set nviewentcoll = policiesview.AllEntries
Call nviewentcoll.RemoveAll(True)

'update Current location document and set the AcceptUpdates = 2

'grabbing current location document from ini file
Dim location As String
location = s.GetEnvironmentString("Location", True)
location = Strleft (location, ",")

Dim locationname As Variant
Set locationview = db.GetView("Adva_nced\Locations")
Set locationdoc = locationview.GetFirstDocument
While Not (locationdoc Is Nothing)
locationname = locationdoc.GetItemValue("Name")
If Strcompare(location, locationname(0)) = 0 Then
'setting the value to 1
Call locationdoc.ReplaceItemValue("AcceptUpdates","1")
Call locationdoc.Save(True,True)
End If
Set locationdoc = locationview.GetNextDocument(locationdoc)
Wend
End Sub
Jacob

Offline DomAdm

  • Senior Mitglied
  • ****
  • Beiträge: 359
  • Geschlecht: Männlich
  • Ich liebe dieses Forum!
Re: Policy per Script auf Client sofort neu laden
« Antwort #3 am: 10.03.20 - 15:28:35 »
Calendar Profile löschen kann Datenverlust bedeuten.
Jacob

Offline CarstenH

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 642
  • Geschlecht: Männlich
Re: Policy per Script auf Client sofort neu laden
« Antwort #4 am: 10.03.20 - 16:47:00 »
Kleine Anmerkung zum Script. Sofern das persönliche Adressbuch nicht zufällig Englisch ist sollte man das Script an einer Stelle anpassen sonst läuft man auf einen Fehler weil die Ansicht "Adva_nced\Locations" nicht gefunden wurde.

Ändern von:
Code
Set locationview = db.GetView("Adva_nced\Locations")
ist zu ändern in:
Code
Set locationview = db.GetView("Locations")

Damit wird der Alias der View angesprochen der in allen Sprachversionen gleich sein sollte.

Carsten

Offline Ice-Tee

  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 725
Re: Policy per Script auf Client sofort neu laden
« Antwort #5 am: 11.03.20 - 07:36:50 »
Hallo, ist es auch möglich den Part "Löschen des Kalenderprofils" rauszunehmen? Oder muss der drin bleiben?
Das würde dann so aussehen.

###

Sub Click(Source As Button)
Dim s As New notessession
Dim db As NotesDatabase
Dim currdb As NotesDatabase
Dim calprofdoc As NotesDocument
Dim locationdoc As NotesDocument
Dim policiesview As NotesView
Dim locationview As NotesView
Dim nviewentcoll As NotesViewEntryCollection

'removes all entries from $Policies view
Set db = s.GetDatabase("","names.nsf")
Set policiesview = db.GetView("$Policies")
Set nviewentcoll = policiesview.AllEntries
Call nviewentcoll.RemoveAll(True)

'update Current location document and set the AcceptUpdates = 2

'grabbing current location document from ini file
Dim location As String
location = s.GetEnvironmentString("Location", True)
location = Strleft (location, ",")

Dim locationname As Variant
Set locationview = db.GetView("Locations")
Set locationdoc = locationview.GetFirstDocument
While Not (locationdoc Is Nothing)
locationname = locationdoc.GetItemValue("Name")
If Strcompare(location, locationname(0)) = 0 Then
'setting the value to 1
Call locationdoc.ReplaceItemValue("AcceptUpdates","1")
Call locationdoc.Save(True,True)
End If
Set locationdoc = locationview.GetNextDocument(locationdoc)
Wend
End Sub

###
« Letzte Änderung: 11.03.20 - 09:48:28 von Ice-Tee »

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz