Hi @Pankajbhakta95 ,
if the script runs fast and without any error ... but the AD User & Computer Console doesn't show the disabled users only after a delay of a few minutes it might be your script us using one DC and the AD User & Computer Console is connected to a different DC. This would explain why you see the result with a delay in the console -> The DCs have to replicate the changes first.
You can try to set the DC in the script with this line:
$PSDefaultParameterValues = @{"*-AD*:Server"="YOUR_DC-COMPUTERNAME"}
And you should select the same DC in the AD User & Computer console as well.
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten