Thank you so much ShaneEP for the script. I have tried this and it's working but only one problem when I put @LServer in the path than it doesn't works.
$inifile = "\\@LServer\netlogon\inifile.ini"
If I change the path as
$inifile = "\\fileserver\netlogon\inifile.ini"
then it works perfectly but I don't want to put server name directly as we have so many servers (domain controller) and if this server go offline then the script will not be able to map the drive. Any idea why it's not working and is there any alternative way.