Skip to main content

Posts

Showing posts from July, 2011

ds: logon request fails when groups > 1024

it's probably not logical for you to do this to yourself and thus there is not much to worry about. however, through a series of nesting groups, you can very well do this without thinking much about it. anyway, by the nature of the fact that I am posting this ... means I ran into it. :(for clarity, the group limitation is actually 1015 when you factor in well-known SIDs.the error messagethis is what you will see when attempting to log in:The system cannot log you on due to the following error: During a logon attempt, the user’s security context accumulated too many security IDs. Please try again or consult your system administrator.
detecting the problemif you want to see how many groups you (or some other user account) is a member of, use the following kinds of commands (may produce different results*):powershell
Get-QADUser myuserid | Select-Object -ExpandProperty allmemberof | measure
cmd shell
dsquery user -samid myuserid | dsget user -memberof -expand | find /c /v ""
* w…

getting the first and last day of the month in sql

i was putting this together for a friend of mine so i thought i would post it since it seems like a pretty useful thing to have. should be self-explanatory.-- first and last for previous month
DECLARE @FirstDayPrev DATETIME
DECLARE @LastDayPrev DATETIME-- first and last for current month
DECLARE @FirstDayCurr DATETIME
DECLARE @LastDayCurr DATETIMESet @FirstDayPrev = CONVERT(VARCHAR(25),DATEADD(mm, DATEDIFF(mm,0,getdate())-1, 0),101)
Set @LastDayPrev = CONVERT(VARCHAR(25),DATEADD(mm, DATEDIFF(mm, 0,getdate())+0, -1),101)Set @FirstDayCurr = CONVERT(VARCHAR(25),DATEADD(mm, DATEDIFF(mm, 0,getdate())+0, 0),101)
Set @LastDayCurr = CONVERT(VARCHAR(25),DATEADD(mm, DATEDIFF(mm, 0,getdate())+1, -1),101)Select @FirstDayPrev, @LastDayPrev, @FirstDayCurr, @LastDayCurr