RE: How to log off different user with different time in Microsoft AX?
                     
                    
                      
                        If your goal setting the value for all users in a group, your need to write a query to fetch these users. You know where users are (UserInfo table); now you need find information about user group assignments, join these tables together and filter by a particular group.
If I remember AX 2009 correctly, the assignment is in UserGroupList table, and we can use code like this to test the query:
UserInfo userInfo;
UserGroupList userGroupList;
while select Id from userInfo
	exists join userGroupList
	where userGroupList.UserId ==  userInfo.Id
	   && userGroupList.GroupId == 'xyz'
{
	info(userInfo.Id);
}
It if gives you the right list of users, use the query in your previous code:
UserInfo userInfo;
UserGroupList userGroupList;
ttsbegin;
while select forUpdate userInfo
	exists join userGroupList
	where userGroupList.UserId ==  userInfo.Id
	   && userGroupList.GroupId == 'xyz'
{
	userInfo.AutoLogOff = 15;
	userInfo.update();
}
ttscimmit;
By the way, please use Insert > Code (in the rich formatting view) when pasting code to this forum. You can see the result above.