In this posting below you will find a script to get an Active Directory User's Group Memberships including nested Group Memberships:
quite a while ago I started this thread: https://www.autoitscript.com/forum/topic/193984-ad-member-of-group-in-group/
#include <AD.au3> _AD_Open() $user=_AD_SamAccountNameToFQDN("ASP") $group=_AD_SamAccountNameToFQDN("daten-Bestellung-QS_lesen") $result=_AD_IsMemberOf($group,$user,false,True) ; $Group is the 1st, $User the 2nd param ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $result = ' & $result & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console _AD_Close() this works fine, thanks for the help in the other thread.
Howto to get the "chain" of groups for nested group memberships?
In AD.AU3 I found the function _AD_RecursiveGetMemberOf(), which might be an approach, (get all the group content then sort out what's needed), just wondering if there is another function that I've overlooked, that directly would give me the "nested membership chain" *ONLY*?
i have a script that selects a text file and deletes a line (text input required) in the text file selected
i have to make it remove all lines found on a file i name, toRemoveLines.txt
it has to remove lines from all text files found in a folder
this is the script that has to be modified
where it says "select file" it has to be "select folder"
where it says "line text input" it has to be all lines from a text file
#Include <File.au3> Global $success = False $file_name = FileOpenDialog("Select file", @ScriptDir, "All files (*.*)", 1+4) $line_text_input = InputBox("Line's text", "Line must contain following text:", "line contains this text") $file_count_lines = _FileCountLines($file_name) for $i = 0 to $file_count_lines $Lines_text_output = FileReadLine($file_name, $i) if StringInStr($Lines_text_output, $line_text_input) then _FileWriteToLine($file_name, $i, "", 1) $success = True ExitLoop EndIf Next if $success = True Then MsgBox(0, "Success", "Line has been deleted") Else MsgBox(0, "Failure", "Line wasn't found") EndIf
I am working on a project where, emails from outlook are to be read and moved to various folders within the mailbox, based on the content of the emails.
I used the below code for moving mails. It works fine when I run it against individual mail ids. But when I run it on Shared mailbox, the mails are not moved to respective folders.
_OL_ItemMove($oOutlook, $sEntryId, Default, $sDestinationFolder) The value of $sEntryId is saved in an excel report initially. The current process reads the $sEntryId from the excel and passes it to "_OL_ItemMove" statement.
Requesting the guidance of the forum members in this issue.
I have a query please
It is about windows file explorer
If i design a tool in autoit language to delete files for example
and i added it in the context menu in File Explorer
If i right-click on any file And you choose the tool, it will be get the path of the selected file or folder
The problem here is
If i select a set of files or folders
it only detect the first one
The code that i used is
if $CMDLine = 0 then
msgBox(16, "error", "you don't selecte any files")
for $i = 1 to $CMDLine
msgBox(0, "files", $CMDLine[$i]
I'm trying to move unread mails from Inbox to a different folder using OutlookEx UDF.
But its not working for me. I'm not sure what mistake I do.
I get the error code 6 when the following is executed. From the UDF it is observed that "No or an invalid item has been specified".
Note : The UDF version is 188.8.131.52. AutoIt version (v184.108.40.206).
#include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $aOL_Item = _OL_ItemFind($oOutlook, "*\Inbox", $olMail, "[UnRead]=True", "", "", "Subject", "", 1) If $aOL_Item = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Could not find a task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error) _ArrayDisplay($aOL_Item, "OutlookEX UDF: _OL_ItemFind Example Script - Unread mails") _OL_ItemMove($oOutlook, $aOL_Item, Default, "*\Outlook-UDF-Test\TargetFolder\Mail") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Error moving specified task. @error = " & @error) Any help is deeply appreciated. Thanks in advance.
Thanks and regards,