Modifies, by uridylylation and deuridylylation, the PII regulatory proteins (GlnB and homologs), in response to the nitrogen status of the cell that GlnD senses through the glutamine level. Under low glutamine levels, catalyzes the conversion of the PII proteins and UTP to PII-UMP and PPi, while under higher glutamine levels, GlnD hydrolyzes PII-UMP to PII and UMP (deuridylylation). Thus, controls uridylylation state and activity of the PII proteins, and plays an important role in the regulation of nitrogen fixation and metabolism. [protein-PII]-L-tyrosine + UTP = [protein-PII]-uridylyl-L-tyrosine + diphosphate [protein-PII]-uridylyl-L-tyrosine + H2O = [protein-PII]-L-tyrosine + H(+) + UMP Uridylyltransferase (UTase) activity is inhibited by glutamine, while glutamine activates uridylyl-removing (UR) activity. Has four distinct domains: an N-terminal nucleotidyltransferase (NT) domain responsible for UTase activity, a central HD domain that encodes UR activity, and two C-terminal ACT domains that seem to have a role in glutamine sensing. Belongs to the GlnD family.