Here is the final code:
On Error Resume Next
'Variable declaration
Dim oFSO, oGroup, oUser, oDomain, oMaxPwdAge, oExcel, oWorkbook
Dim iRow, iUserAccountControl, dtmValue, iTimeInterval, dblMaxPwdNano
Set oFSO = CreateObject("scripting.filesystemobject")
Set oGroup =...
Markdmac's code works (no big surprise really). I'm gonna make a few more tweaks to remove some redundant messages in the .txt file. Once this is done I'll post the finalized code here for all.
Thanks again Mark!
I have updated my code as follows:
Sub enumMembers(oGroup)
For Each oUser In oGroup
If oUser.Class = "user" Then
iUserAccountControl = oUser.Get("userAccountControl")
If iUserAccountControl And ADS_UF_DONT_EXPIRE_PASSWD Then
oFile.WriteLine oUser.department & "/" &...
Goal: a text file showing the password status for every user in AD.
Problem: the script quits unexpectedly as soon as it gets to a user whose "User must change password at next logon" box is checked. My understanding is that this status should trigger the "password has expired" Else routine...
Goal: a .hta page that will allow users to reset the password only for users within their dept & email IT to notify that it was done.
Problem: UserList.value in Sub ResetPassword does not include any characters after the space between first & last names. So in testing the name "Jane Smith"...
Found the solution:
1. Created an OnOpen event on fsubClose that invoked the code builder. No specific code added, but now it showed in the lefthand pane of the Visual Basic coding popup.
2. Changed my OnClick event on frmNewTicket as follows:
Private Sub Command87_Click()
If...
Main form is called frmNewTicket, subform is called fsubClose. fsubClose's default visible property is No. I created a command button on frmNewTicket & for its OnClick event I have the following code:
Private Sub Command87_Click()
Me!Forms!fsubClose!Form!Visible = True
End Sub
When I click...
OK, added the following as the Load event procedure:
Private Sub Form_Load()
Me![ITStaff] = GetUserName_TSB()
End Sub
After adding this when I open the form I get the following error message: "Compile error: expected variable or procedure, not module
PHV, I got the following error when I added your command to the On:
Microsoft Office Access can't find the macro 'Me!ITStaff=GetUserName_TSB().'
I double-checked: GetUserName_TSB is saved as a module (not a macro) & consists of only the code I pasted above.
Am trying to have a textbox on my form auto-populate with the ID of the user currently logged onto the PC when the form is opened. I created a module w/ the following code from faq702-4949:
Public Function GetUserName_TSB() As String
On Error GoTo error_handler
Dim lngLen As Long
Dim strBuf As...
Am now getting a "Path Not Found" error on this line:
oFSO.CopyFile "\\server\share\file", "\\" & RemotePC(a) & "\file", True
I confirmed the file's presence in the correct folder on the file server & that the folder is shared to Everyone. I was also able to ping the destination workstations...
I am trying to copy a single file to multiple PCs (using a text file to generate the array of workstation names) then verify the file was copied. For testing purposes the text file currently has only 2 PCs listed in it, 1 is Win2K & the other is XP. Here's my code:
Option Explicit
'Declare...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.